hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: Should Multiple threads use same HttpClient object
Date Fri, 19 Oct 2007 17:54:24 GMT
Puneet Lakhina wrote:
> I hope I am interpreting it right.

yes

> If i am making threads by implementing
> Runnable, then the HttpClient instance should be a static variable,
> something like the following.
> public MyThreads implements Runnable{
> private static HttpClient client = new HttpClient(new
> MultiThreadedHttpConnectionManager());
> public void run() {
> try {
> client.executeMethod(method);
> }finally {
> method.releaseConnection();
> }
> }
> }
> 
> hope that helps,
>>   Roland
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>>
>>
> 
> 


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


Mime
View raw message