apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject How to detect is the socket is still open
Date Wed, 02 Aug 2006 11:42:52 GMT
Hi,

We have a problem with mod_proxy and
the way how we detect if the connection is
still opened.

Right now, the algorithm for that is as follows:
1. Remember socket timeout
2. Set timeout to 0
3. Try to read one byte
4. Restore timeout
6. If read is APR_STATUS_IS_EOF return False
5. Else return True

Now, this works most of the time on unixes,
but it fails for windows if connection goes
to the localhost.

We have that resolved for mod_jk by using
select on windows and nonblocking read on
other platforms.
See:
jk_connect.c inside jk/native/common

My question is, if someone is aware of the
smarter mechanism for checking the socket
connection, and if we could add the function
for that inside APR.


Regards,
Mladen.

Mime
View raw message