Is there a way to flush a POSIX socket?

后端 未结 8 1211
误落风尘
误落风尘 2020-11-30 04:20

Is there a standard call for flushing the transmit side of a POSIX socket all the way through to the remote end or does this need to be implemented as part of the user level

8条回答
  •  甜味超标
    2020-11-30 05:25

    Use fsync():

    sock_fd is integer file descriptor from socket(..., ...) call

    fsync(sock_fd);

提交回复
热议问题