public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Dup'd sockets lose error information
Date: Wed, 23 Apr 2014 15:38:00 -0000	[thread overview]
Message-ID: <20140423153830.GN2339@calimero.vinschen.de> (raw)
In-Reply-To: <20140423142541.156360@gmx.com>

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

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 #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-04-23 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 14:25 qq qq
2014-04-23 15:38 ` Corinna Vinschen [this message]
2014-04-24 14:14   ` Corinna Vinschen
2014-05-05  9:08     ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140423153830.GN2339@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).