delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2002/07/05/09:20:53

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
X-Authentication-Warning: atacama.four-d.de: mail set sender to <tpfaff AT gmx DOT net> using -f
Date: Fri, 5 Jul 2002 15:20:19 +0200 (=?ISO-8859-1?Q?Westeurop=E4ische_Sommerzeit?=)
From: Thomas Pfaff <tpfaff AT gmx DOT net>
To: cygwin-developers AT cygwin DOT com
Subject: Re: Select with nonblocking connects
In-Reply-To: <20020705144828.M21857@cygbert.vinschen.de>
Message-ID: <Pine.WNT.4.44.0207051457380.256-100000@algeria.intern.net>
X-X-Sender: pfaff AT antarctica DOT intern DOT net
MIME-Version: 1.0

I guess the easiest way is to add a flag in fhandler_socket that is set
when a connect is in progress. If it is set then add the sock handle to
exceptfds as well. After select returns check the exceptfds, if the socket
is signaled set it in writefds too. In UNIX you have to check the SO_ERROR
sockopt to know if the connect has succeded or failed, but winsock sets is as
well. Now clear the in_progress flag.

For listening sockets i see no difference.

Thomas

P.S.: Time for a break and to move to a "Biergarten".

On Fri, 5 Jul 2002, Corinna Vinschen wrote:

> On Fri, Jul 05, 2002 at 11:27:22AM +0200, Thomas Pfaff wrote:
> >
> > There was a message in cygwin ml regarding nonblocking connects with
> > select. Will this be fixed to a unix compliant version or should i answer
> > him that he should use the exceptfds to get failed connects signaled ?
>
> We should try to create a Unix compliant behaviour but it doesn't hurt
> to tell him to use exceptfds until that's fixed.  So, go ahead.
>
> Do you have an idea how to implement that?
>
> AFAICS, Linux also returns the fd in writefd if the connect hasn't been
> called yet and as long as no listen() has been called on the socket.
> So, probably we could add a flag `dont_use_in_select' to fhandler_socket.
>
> As long as it's 0, the SOCKET isn't used in a call to the Winsock
> select() but it's set in writefd automatically.
>
> The flag is set to 1 if a listen or a connect succeeds.  After that,
> it's given to Winsock select() as usual.
>
> What do you think?
>
> Corinna
>
> --
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Developer                                mailto:cygwin AT cygwin DOT com
> Red Hat, Inc.
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019