apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jus...@erenkrantz.com>
Subject Re: 100% cpu with APR on Windows
Date Fri, 27 May 2011 08:30:54 GMT
On Fri, May 6, 2011 at 4:01 AM, Jeff Trawick <trawick@gmail.com> wrote:
> WSAPoll() is available with Vista/2008 Server and later.  It should be
> used automatically by APR without rebuilding your code (via a run-time
> check for presence of the Windows API).
>
> As far as WSAPoll() and this issue...  MS doc says
>
> "POLLHUP        A stream-oriented connection was either disconnected or aborted."
>
> POLLHUP is mapped to APR_POLLHUP.
>
> (IOW, I didn't test but it looks promising.)

FWIW, serf is running into a similar issue when a connection is made
to a server on a non-existent port.  (The Subversion folks have marked
this as a blocking bug for 1.7.x.)  It looks like WSAPoll() may not
work properly with non-blocking connect() calls:

http://social.msdn.microsoft.com/Forums/en/wsk/thread/18769abd-fca0-4d3c-9884-1a38ce27ae90

The apr_pollset_poll call never indicates a failure (so it only
returns after the timeout expires and says nothing interesting
happened).  Reading the connect() docs, it appears that you have to
call select() - not WSAPoll() - to figure out the status of the
connect() call:

http://msdn.microsoft.com/en-us/library/ms737625(v=VS.85).aspx

Has anyone else seen this behavior?  Anybody have any clever
workarounds?  -- justin

Mime
View raw message