This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Interruptable connect


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]