netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* EOF and zero-length packets?
@ 2008-12-02 18:57 Rémi Denis-Courmont
  0 siblings, 0 replies; only message in thread
From: Rémi Denis-Courmont @ 2008-12-02 18:57 UTC (permalink / raw)
  To: netdev

	Hello,

When dealing with SOCK_STREAM sockets, a zero read means the other side has 
shut down the connection, and there will be no more incoming data.

When dealing with SOCK_DGRAM/SOCK_RAW sockets, a zero read means we got an 
empty packet, and we should keep on reading.

What about SOCK_DCCP? It seems both scenarios yield zero, which is, hmm, 
problematic from userland. Is checking for POLLHUP in revents the recommended 
disambiguation? that seems a bit backward to me :(

-- 
Rémi Denis-Courmont
http://www.remlab.net/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-02 18:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-02 18:57 EOF and zero-length packets? Rémi Denis-Courmont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).