Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: Corinna Vinschen <cygwin@cygwin.com>
Date: Sat, 9 Dec 2000 21:46:01 +0100
X-Mailer: KMail [version 1.1.99]
Content-Type: text/plain;
  charset="US-ASCII"
To: cygwin@cygwin.com
References: <Pine.LNX.4.10.10012091358380.15913-100000@alliance.centerclick.org>
In-Reply-To: <Pine.LNX.4.10.10012091358380.15913-100000@alliance.centerclick.org>
Subject: Re: getsockname() doesn't fill out data after non-blocking connect()
MIME-Version: 1.0
Message-Id: <00120921460101.17980@cygbert>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id QAA06308

On Saturday 09 December 2000 20:17, Dave Johnson wrote:
> While porting an application to cygwin I've discovered the following:
>
> After a non-blocking connect() is called for a TCP connection I am
> calling getsockname() to determine the IP on the local size of the
> connection attempt.
>
> After calling getsockname() and getting the IP address from
> ..sin_addr.s_addr of the sockaddr_in structure the IP was filled out
> with 0's instead of the IP address of the interface in which the
> connection attempt is going out on.
>
> Doing another getsockname() after the socket becomes writable and the
> connection is completed returns valid data.
>
> Other UNIX OS's will return valid socket information after a
> non-blocking connect().  Is this a limitation of cygwin or a bug?

It's a limitation of Winsock. It could perhaps been worked around
in Cygwin. Patches are welcome.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.
mailto:vinschen@redhat.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

