commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kenny Smith <>
Subject [httpclient] How to determine if connection is alive?
Date Mon, 24 Mar 2003 19:12:55 GMT

I'm currently using 2.0a1 (I can't upgrade to the current release yet 
for production reasons) and I'm using Keep-Alive connections. I would 
like to find out if my connection is still alive, but I can't find any 
way to determine that. I've found the isAlive() method in HttpConnection 
object, but I can't find anyway to get an instance of the HttpConnection 

My overall goal: We are testing an application where apache will have 
Keep-Alives turned off. My testing app will use HttpClient to try to 
create a Keep-Alive connection and hold it open as long as possible. In 
the previous version, the thread making the request would just sleep for 
x number of seconds, but I want the code to move ahead and make the next 
request if apache forces the connection closed (i.e. correctly stops the 
Keep-Alive) so simply sleeping x number of seconds blindly doesn't work 
for me.

Any help is appreciated, thanks!
Kenny Smith

View raw message