Check that write()/send() can process whole buffer without block, fail otherwise (no partial write)

谁都会走 提交于 2019-12-05 18:05:50

Experiment reveals that no partial send occurs on my setup (glibc 2.11.1, kernel 2.6.32-29) and that EAGAIN/EWOULDBLOCK is returned by send(...MSG_DONTWAIT) as expected for AF_UNIX+SOL_SEQPACKET socket.

Not sure whether behavior is universal.

Reading the value of SO_SNDLOWAT on the socket will give you a clue as to the sizes of messages that can be sent without risking partial sends.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!