This is the mail archive of the 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: connect() not interrupted by sigalrm?

On Mon, Feb 24, 2003 at 12:57:26PM -0500, Eric Mandel wrote:
> Cygwin version:		1.3.20-1
> Win OS tested:		NT 4.0/SP6 and XP
> I have an application that calls alarm() before connect() in order to
> prevent connect() from hanging if the host is down or non-existent.
> When alarm() goes off, it sends the SIGALRM signal, which interrupts
> the connect() system call.  This works under Linux, Solaris, OSF, and
> Mac OS X, but apparently not under Cygwin. As shown in the appended
> code, the alarm does go off and can trigger an associated alarm
> function, but the connect() system call is not interrupted.

The Cygwin connect() call isn't interruptible so far.  It's still
implemented by just calling the WinSock connect() plus some magical
hocus-pocus afterwards.  It's possible to change it to an interruptible
call but that requires some coding.

In the meantime, how about using a non-blocking connect() and a call to
select() instead?


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin at cygwin dot com
Red Hat, Inc.

Unsubscribe info:
Bug reporting:

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