apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: How to detect is the socket is still open
Date Wed, 02 Aug 2006 12:25:19 GMT
On Wed, Aug 02, 2006 at 01:42:52PM +0200, Mladen Turk wrote:
> We have a problem with mod_proxy and the way how we detect if the 
> connection is still opened.

Polling the socket is all you can do, but all that tells you is whether 
the local end of the TCP socket has already received a FIN/RST.

If you are in a situation where the connection can be closed 
asynchronously (as with HTTP) it is ultimately pointless to attempt 
this.  There will always be a race between when you check the socket and 
when you use it in which time the server may close the connection; so 
you need to be able to cope with that anyway.

(if you are indeed talking about HTTP then see the discussion around the 
r378032 commit on dev@httpd)

joe

Mime
View raw message