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: bug in cygwin select/socket code(?)

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 (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 Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
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]