apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Erenkrantz" <jus...@erenkrantz.com>
Subject Re: [Fwd: Re: How to detect is the socket is still open]
Date Wed, 16 Aug 2006 14:00:48 GMT
On 8/16/06, Davi Arnaut <davi@haxent.com.br> wrote:
> The only portable way to "detect" a broken connection is using
> or to write/read "ping" data through the socket -- which is what
> keepalive does.

How would SO_KEEPALIVE help?  The other end is deliberately closing
the connection and we need to know that.

Would a non-blocking read() followed by a poll()/select() be useful?
We'd still get a 0 back from read() - but if it was the EOF, would the
state of the socket change to be in the 'exceptional' state then if we
repoll?  -- justin

View raw message