Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 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. 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/