public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <rdenis@simphalempin•com>
To: netdev@vger•kernel.org
Subject: EOF and zero-length packets?
Date: Tue, 2 Dec 2008 20:57:45 +0200	[thread overview]
Message-ID: <200812022057.45844.rdenis@simphalempin.com> (raw)

	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/

                 reply	other threads:[~2008-12-02 18:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200812022057.45844.rdenis@simphalempin.com \
    --to=rdenis@simphalempin$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox