Messages in this thread | | | Date | Mon, 07 Dec 2009 21:06:30 -0600 | From | Robert Hancock <> | Subject | Re: Error in SEND(2) man page ? |
| |
On 12/07/2009 12:43 PM, Jacques, Hugo wrote: > > Hi, > > I think I found a discrepancy between the man page of send()and the actual implementation. > > Man page mentions that: > > "[...] 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 fail with the error EAGAIN or EWOULDBLOCK in this case. [...]" > > This tells me that if doing a send() on a tcp non-blocking socket whose send buffer is full, the call should return with -1 and errno=EAGAIN. > > But running a trivial test app (code below), send() will indicate (return value) that is sent some but not all of the data buffer when the socket's send buffer is full. > > Am I missing anything? > Is the man page or the code wrong?
I think the man page would be right for a datagram (ex: UDP) socket, but not for a stream (ex: TCP) socket, as a stream socket has no real concept of "messages".
| |