Joe Orton wrote:
> 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.
>

Right. I'm aware of that, and all the problems. However it really
works only on windows.
The solution I had in my mind was to add a small
(1 byte should be enough) read-ahead buffer to the
socket. This way the next read would first use that buffer if
filled by apr_socket_is_connected call.
The point is that read with 0 timeout can return data,
and that breaks any attempt to check the status of the socket
without duplicating code for each protocol (http, ajp, ftp, etc...).

Regards,
Mladen.

Reply via email to