1. socket 的阻塞与非阻塞的含义:
When the message does not fit into the send buffer of the socket, send() normally blocks, unless the socket has been placed in nonblocking I/O mode. In nonblocking mode it would fail with the error EAGAIN or EWOULDBLOCK in this case. The select(2) call may be used to determine when it is possible to send more data.
socket 的发送 buffer 和接收 buffer 的大小可以分别通过 getsockopt 和 setsockopt 获取和设置。
阅读(765) | 评论(0) | 转发(0) |