delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/22/04:59:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 22 Nov 2002 10:59:07 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: bug in cygwin select/socket code(?)
Message-ID: <20021122105907.H1398@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT NEB DOT 4 DOT 44 DOT 0211220110240 DOT 8604-100000 AT panix1 DOT panix DOT com>
Mime-Version: 1.0
In-Reply-To: <Pine.NEB.4.44.0211220110240.8604-100000@panix1.panix.com>
User-Agent: Mutt/1.3.22.1i

On Fri, Nov 22, 2002 at 01:11:35AM -0500, Wayne Clerke wrote:
> The Perl code below creates a non-blocking socket and attempts
> to connect it to 127.0.0.1:2 (which should be immediately refused),
> The loop shows the socket becomes briefly writable according to
> IO::Select. Is there some logic behind this that I'm missing?
> It was ok in cygwin v1.3.12-2, but hasn't worked as I expected
> in the last two releases (1.3.14-1, 1.3.15-2) .

It's ok as it is now.  It was incorrect before.  The connect doesn't
return immediately and FD_ISSET (fd, &writefds) returns true when the
connection is refused.  See SUSv3:

<quote http://www.opengroup.org/onlinepubs/007904975/functions/select.html>
  If a non-blocking call to the connect() function has been made for a
  socket, and the connection attempt has either succeeded or failed
  leaving a pending error, the socket shall be marked as writable.
</quote>

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019