I took a quick look at the code. In HttpMethodBase, the releaseConnection()
method does close the stream if there is one. It looks like the stream will
always be closed if you're using the base classes. 

--Steve

-----Original Message-----
From: Pesonen, Petteri [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 02, 2006 2:44 AM
To: [email protected]
Subject: Closing a stream when multithreading

Hi,

I have updated to the HttpClient 3.0 and I have a questing concerning
the use of MultiThreadedHttpConnectionManager and the
method.getResponseBodyAsStream() method.

According to the code example in threading guide
(http://jakarta.apache.org/commons/httpclient/threading.html) the stream
returned by the getResponseBodyAsStream() is not closed, but then again
the main tutorial states:

"Call method.getResponseBodyAsStream() and read the entire contents of
the stream then call stream.close(). ..."

So, just to be sure. The stream must always be closed even when using
the MultiThreadedHttpConnectionManager? Right?


-- 
Petteri  :: +358-40-8619334

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to