public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-developers@cygwin.com
Subject: Re: Questions about select for sockets
Date: Tue, 6 Apr 2021 18:28:45 +0200	[thread overview]
Message-ID: <YGyMPZOxpSnWaApt@calimero.vinschen.de> (raw)
In-Reply-To: <f93cb767-e621-d462-d44d-c66b6becc526@cornell.edu>

On Apr  6 11:44, Ken Brown wrote:
> On 4/6/2021 10:33 AM, Corinna Vinschen wrote:
> > On Apr  6 16:20, Corinna Vinschen wrote:
> > > On Apr  3 14:16, Ken Brown via Cygwin-developers wrote:
> > > > 4. Why do we set
> > > > 
> > > >    except_ready = saw_shutdown_write () || saw_shutdown_read () ?
> > > > 
> > > > I can't find any documentation that says that a shutdown should be
> > > > considered an exceptional condition.  On the other hand, POSIX does say,
> > > > "Other circumstances under which a socket may be considered to have an
> > > > exceptional condition pending are protocol-specific and
> > > > implementation-defined."  So maybe there's some Cygwin-specific reason for
> > > > doing this?
> > > 
> > > Nope, this is old (and wrong) cruft.  Neither Steven's book nor the
> > > Linux man pages, nor testing on Linux imply that ready for exception
> > > is used to indicate anything other than out-of-band data.  This should
> > > be fixed.
> > 
> > We may also have to change the saw_shutdown_read/saw_shutdown_write
> > handling.  I checked this on Linux and what happens is:
> > 
> >    After shutdown (fd, SHUT_RD), the socket is ready for reading and writing
> 
> This seems surprising to me.  Is it really the shutdown that caused it to be
> ready for writing in your test, or was it ready for writing anyway (e.g.,
> because the relevant buffer was empty)?

I guess so, too.  How to make sure the socket isn't ready for writing
without going to great lengths?


Corinna

  reply	other threads:[~2021-04-06 16:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-03 18:16 Ken Brown
2021-04-06 14:20 ` Corinna Vinschen
2021-04-06 14:33   ` Corinna Vinschen
2021-04-06 15:44     ` Ken Brown
2021-04-06 16:28       ` Corinna Vinschen [this message]
2021-04-06 17:37         ` Ken Brown
2021-04-06 18:24           ` Corinna Vinschen
2021-04-06 19:36             ` Corinna Vinschen
2021-04-07 14:04               ` Ken Brown
2021-04-07 15:31                 ` Corinna Vinschen

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=YGyMPZOxpSnWaApt@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-developers@cygwin.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).