lkml.org 
[lkml]   [2009]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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".


\
 
 \ /
  Last update: 2009-12-08 04:09    [W:0.034 / U:7.048 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site