hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cordes, Hans-Dieter" <hdcor...@emea.att.com>
Subject HttpClient: Release all resources due to a Thread.interrupt
Date Fri, 20 May 2005 14:01:39 GMT

I need some assistance with the following problem:

I have a thread X that will be allowed to live only for a specified amount of time. In that
thread I have an HttpClient object that I use to send a POST to another server machine. Now
I want to make sure that when my thread X is interrupted, because its time-out has expired,
I am able to release all resources of the HttpClient object. What do I have to do?

I would think that basically I should simply close the corresponding socket via the HttpConnection
object that HttpClient uses. But I have not found a way to get this HttpConnection object
given that I have references to HttpClient and PostMethod. (Perhaps I should first close/release
the request/response I/O channels, but when the socket goes down, this should be done automatically.
And perhaps I could also use the HttpClient.setTimeout method?)

Many thanks in advance for your help.

	Hans-Dieter Cordes

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message