hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Lubashev" <IgorLubas...@everypoint.com>
Subject RE: Managing connections
Date Tue, 15 Aug 2006 22:13:59 GMT

Since the docs are rather sparse on this topic, do I need to call
releaseConnection() after abort()?  Also, are abort() and/or
releaseConnection() idempotent?

While we are at it, I am planning to use the httpclient in my app by
getting the body as a stream and then reading data from that stream in
chunks, each chunk in a possibly different thread.  That is, only one
thread will access the stream at a time, but the next time the stream is
accessed, it could be accessed from a different thread.  Is this safe?
Or does httpclient use some ThreadLocal storage somewhere?

Many thanks,

- Igor

On Tue, 2006-08-15 at 14:47 -0700, Igor Lubashev wrote:
> Hi!
> I am new to this list, so I apologize if this topic has been beaten to
> death already.
> I am reading the tutorial, and it claims that I always must fully read
> the body of the response (of the GET method, for example) before
> releasing the connection.
> What should I do if I really do not care about the response body
> because of the status code or because I suspect that the server is a
> rouge server and is sending me an infinite-sided body)?  If there a
> to cleanly either abort the current method or cleanly kill the
> connection (and let the MultiThreadedHttpConnectionManager open
> one next time it is needed)?

HttpMethod#abort is your friend

Hope this helps


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

View raw message