Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com Date: Wed, 26 Feb 2003 18:34:29 +0100 From: Corinna Vinschen To: cygwin-developers AT cygwin DOT com Subject: Re: Interruptable connect Message-ID: <20030226173429.GA22762@cygbert.vinschen.de> Reply-To: cygwin-developers AT cygwin DOT com Mail-Followup-To: cygwin-developers AT cygwin DOT com References: <20030225180438 DOT GT8853 AT cygbert DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i On Wed, Feb 26, 2003 at 03:04:36PM +0100, Thomas Pfaff wrote: > This is in accordance with > > http://www.opengroup.org/onlinepubs/007904975/functions/connect.html : > > If connect() is interrupted by a signal that is caught while blocked > waiting to establish a connection, connect() shall fail and set errno to > [EINTR], but the connection request shall not be aborted, and the > connection shall be established asynchronously. > [...] > When the connection has been established asynchronously, select() and > poll() shall indicate that the file descriptor for the socket is ready for > writing. Funny, isn't it? Just a bit of reading... *sic*. > The connect can be changed to look like this : > [...] Yup, that's quite what I was thinking. > I have not tested this code yet. I will generate a patch if you agree. Sure! I would be more than happy. > BTW, i see a really strange behaviour with select and getsockopt, it seems > that SO_ERROR is set some time after the select is signaled. Here is a > WIN32 test case : > [...] > The first call to getsockopt returns 0 in sock_error, the second will > return 10061 as expected. > > This is on NT4 German, SP6 > > Can you duplicate this ? No, I can't. I'm running XP SP1. The first call to getsockopt(SO_ERROR) already returns 10061 reproducibly. Seems to be a NT4 issue. Anybody here with W2K? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc.