This is the mail archive of the cygwin 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: Dup'd sockets lose error information


On Apr 23 16:25, qq qq wrote:
> The following code is a simplified app that was used to test-connect
> to local ports 55000+ (none of which were actually listening) and
> received false-positive "connected" results because Cygwin's dup()
> for socket causes SO_ERROR to be lost. ÂSince FD_SETSIZE is only 64 on
> Cygwin, the app uses dup()'s to lower the descriptors as it checks
> them for completion. ÂThere is no such problem on Linux.
> Also, strangely that Cygwin does not accept sin_addr as 0 to connect
> locally (and either localhost or local host IP must be stuffed in
> there, otherwise resulting in the "Cannot assign requested address"
> error).

This is Winsock at work.  Cygwin doesn't check the AF_INET address
when calling Winsock's connect, so Winsock's connect itself seems to
have this issue.

As for the SO_ERROR value, I have to check.  Thanks for the testcase.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgppX652qNwB5.pgp
Description: PGP signature


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