apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henry Jen <henry...@ztune.net>
Subject Re: apr_pollset_poll does not return when socket closed
Date Fri, 01 Sep 2006 17:46:35 GMT
Justin Erenkrantz wrote:
> On 8/31/06, Henry Jen <henryjen@ztune.net> wrote:
>> Haven't get a chance to test on other platform, but wondering if this is
>> reasonable to expect. If it is, what do I miss in the testing code?
> You should read:
> http://mail-archives.apache.org/mod_mbox/apr-dev/200608.mbox/%3c44D113D0.9080001@apache.org%3e

> In short, there's no way to portably detect the socket is closed via a
> poll()-like mechanism.  It seems like everyone keeps running into
> this.  Apparently, the only way to know if it is closed is to read()
> from it - which really sucks.  -- justin

Thanks for the pointer. :-)

As I read it, seems like I could expect it to return from poll, just the 
event can be different, is that correct?

The result I see is that apr_pollset_poll is not returning.

My guess is that because there is no connection at all because what the 
code does is simply listening on the socket.

If that's not possible, how do I remove the socket from the pollset in a 
thread-safe way on platforms using select like Win32?


View raw message