mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Lluís Batlle" <viriketo@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: bug in select() in linux
Date: Mon, 12 Mar 2007 16:02:11 +0100	[thread overview]
Message-ID: <45219fb00703120802y78cf4dbds6e89b58de9d0f801@mail.gmail.com> (raw)
In-Reply-To: <20070312160104.25d6b321@lxorguk.ukuu.org.uk>

Oh, of course you're right. I was inside too much layers to think of
the tcp protocol, and I did not pay attention to it.

Maybe something could be added to the manpage anyway.

The bad thing is that there's no way I can use a socket for writing
using select() if that connection has been half-closed by the other
end. Moo.

Thanks a lot for your time,
Lluís

2007/3/12, Alan Cox <alan@lxorguk.ukuu.org.uk>:
> > I've tried a select() for write against a closed tcp socket (closed by
> > the other side), and the select call _blocks_.
>
> A TCP close from the remote node is single sided. It sends a FIN and we
> ACK the FIN, that means only that the remote node has completed *sending*.
>
> > Any write() call to that socket will _not block_, and will return with EPIPE.
>
> We don't know this until you try the write. At that point the other end
> if it has closed entirely will issue an RST and terminate the connection
> in full.
>
> I don't therefore believe that this is actually a bug.
>
> Alan
>

  parent reply	other threads:[~2007-03-12 15:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 14:51 Lluís Batlle
     [not found] ` <20070312160104.25d6b321@lxorguk.ukuu.org.uk>
2007-03-12 15:02   ` Lluís Batlle [this message]
2007-03-12 15:08     ` Alistair John Strachan
2007-03-12 15:15       ` Lluís Batlle
2007-03-12 17:03     ` Alan Cox

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=45219fb00703120802y78cf4dbds6e89b58de9d0f801@mail.gmail.com \
    --to=viriketo@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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

all inboxes | Powered by JetHome®