delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2003/02/26/12:35:16

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <vinschen AT redhat DOT com>
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> <Pine DOT WNT DOT 4 DOT 44 DOT 0302261114300 DOT 352-100000 AT algeria DOT intern DOT net>
Mime-Version: 1.0
In-Reply-To: <Pine.WNT.4.44.0302261114300.352-100000@algeria.intern.net>
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.

- Raw text -


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