apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saxon" <sa...@saxon.cx>
Subject Re: [Q] apr_poll_revents_get() before apr_accept() on Windows
Date Mon, 25 Mar 2002 00:24:54 GMT
Hi,

I ran into the same problem a couple of days ago. I modified the
implementation of apr_poll_revents_get() to the attached file, to fix the
problem. Basically, if the socket is listening, then the WSARecv isn't done.
Also I added another fix where if the WSARecv returns zero bytes on a
stream-type socket, that indicates a graceful shutdown (APR_POLLHUP instead
of APR_POLLIN).

I can create a proper diff-style patch for this if people agree it's
sensible?

cya,
Saxon

----- Original Message -----
From: "INOUE Seiichiro" <inoue@ariel-networks.com>
To: <dev@apr.apache.org>
Sent: Monday, March 25, 2002 12:32 AM
Subject: [Q] apr_poll_revents_get() before apr_accept() on Windows


> Hi,
>
> I have a question about apr_poll_revents_get() behavior on Windows.
> I want to check whether the socket is apr_accept()'able.
> On Unix, I can check the socket becomes readable by apr_poll().
> On Windows, when I do the same thing, apr_poll_revents_get() returns
APR_POLLERR.
>
> In apr_poll_revents_get(), WSARecv() causes WSAENOTCONN,
> if the socket hasn't been apr_accept()'ed yet.
> (Windows2000 case. I don't know other Windows.)
>
> I attach a sample program for an easy reproduction.
>
> My question is,
> What is a proper solution?
> libapr should take care of it, or applications should?
>
> Thanks in advance.
>
> - INOUE Seiichiro <inoue@ariel-networks.com>
>   http://www.ariel-networks.com

Mime
View raw message