- 论坛徽章:
- 0
|
谢谢3楼!
recv:
If no messages are available at the socket, the receive calls wait for
a message to arrive, unless the socket is nonblocking (see fcntl(2)) in
which case the value -1 is returned and the external variable errno set
to EAGAIN. The receive calls normally return any data available, up to
the requested amount, rather than waiting for receipt of the full
amount requested.
证明问题2的答案是前者。
send:
When the message does not fit into the send buffer of the socket, send
normally blocks, unless the socket has been placed in non-blocking I/O
mode. In non-blocking mode it would return EAGAIN in this case. The
select(2) call may be used to determine when it is possible to send
more data.
send的似乎没说清楚,“does not fit into”指的是all还是any? |
|