httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: [PATCH] win32/sockets.c - remove select in connect routine
Date Wed, 20 Sep 2000 18:49:38 GMT
Gregory Nicholls <> writes:

> Jeff Trawick wrote:
> > . I modified the client test program to wait for the connect to
> > complete, and then call apr_connect() again to find out what happened
> This shouldn't be necessary. AFAIK when the socket is available for writing the connect
> complete. What's
> the second call telling us ??

We don't know whether or not the connect was successful.  On Unix, it
is normal to call connect() again once select() pops; the retcode from
connect() tells us whether or not the connection was established.

> > . I modified (kludged) unix/canonerr.c to map WSAEWOULDBLOCK to
> > APR_EAGAIN; connect() on Win32 returns WSAEWOULDBLOCK in the
> > non-blocking case
> See a previous note where I posted a version of canonerr.c for Win32 that has this and
a few others
> as well.

I'm not eager to mess with error codes, so I was testing with a
minimal set of changes.  Besides, Ryan said he was going to handle
your canonerr.c patch :)

> > With my patch, the client test program is broken when it does a
> > non-blocking apr_connect() on Win32.  I try to use apr_poll() to find
> > out when the connect is done, but apr_poll() doesn't return when
> > the connect succeeds/fails.  Maybe I need to pass a different flag?
> > Maybe it just won't work this way on Win32?  This needs more
> > research.
> >
> > In your testing, what did you do to find out when the connect() is
> > done?  That is the missing piece.
> Well all I did was issue a select() with that socket in the write set. I confess I didn't
use the
> apr_poll() routine
> so perhaps there's something odd in there. I'll have a bit of a look at the poll routine
and the
> client and see what pops up.

Good...  Google told me I could wait for the FD_EVENT event on the
socket to find out when the connect is done, but I don't see how that
fits into the apr_poll() abstraction.

Jeff Trawick | | PGP public key at web site:
          Born in Roswell... married an alien...

View raw message