You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Russell Brown <ru...@basho.com> on 2011/07/19 13:50:14 UTC
One ThreadSafeClientConnManager, many DefaultHttpClients
Hi,
Is this OK
ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
DefaultHttpClient httpClient1 = new DefaultHttpClient(cm);
httpClient1.setHttpRequestRetryHandler(handler1);
DefaultHttpClient httpClient2 = new DefaultHttpClient(cm);
HttpParams cp2 = http.getParams();
cp2.setIntParameter(AllClientPNames.CONNECTION_TIMEOUT, 1000);
DefaultHttpClient httpClient3 = new DefaultHttpClient(cm);
httpClient3.setHttpRequestRetryHandler(handler3);
HttpParams cp3 = http.getParams();
cp3.setIntParameter(AllClientPNames.CONNECTION_TIMEOUT, 5000);
Many thanks in advance
Russell
Re: One ThreadSafeClientConnManager, many DefaultHttpClients
Posted by Russell Brown <ru...@basho.com>.
On 19 Jul 2011, at 13:20, Oleg Kalnichevski wrote:
> On Tue, 2011-07-19 at 12:50 +0100, Russell Brown wrote:
>> Hi,
>> Is this OK
>>
>> ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
>>
>> DefaultHttpClient httpClient1 = new DefaultHttpClient(cm);
>> httpClient1.setHttpRequestRetryHandler(handler1);
>>
>> DefaultHttpClient httpClient2 = new DefaultHttpClient(cm);
>> HttpParams cp2 = http.getParams();
>> cp2.setIntParameter(AllClientPNames.CONNECTION_TIMEOUT, 1000);
>>
>> DefaultHttpClient httpClient3 = new DefaultHttpClient(cm);
>> httpClient3.setHttpRequestRetryHandler(handler3);
>> HttpParams cp3 = http.getParams();
>> cp3.setIntParameter(AllClientPNames.CONNECTION_TIMEOUT, 5000);
>>
>> Many thanks in advance
>>
>> Russell
>>
>
> It is OK.
Awesome, thank you!
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: One ThreadSafeClientConnManager, many DefaultHttpClients
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2011-07-19 at 12:50 +0100, Russell Brown wrote:
> Hi,
> Is this OK
>
> ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
>
> DefaultHttpClient httpClient1 = new DefaultHttpClient(cm);
> httpClient1.setHttpRequestRetryHandler(handler1);
>
> DefaultHttpClient httpClient2 = new DefaultHttpClient(cm);
> HttpParams cp2 = http.getParams();
> cp2.setIntParameter(AllClientPNames.CONNECTION_TIMEOUT, 1000);
>
> DefaultHttpClient httpClient3 = new DefaultHttpClient(cm);
> httpClient3.setHttpRequestRetryHandler(handler3);
> HttpParams cp3 = http.getParams();
> cp3.setIntParameter(AllClientPNames.CONNECTION_TIMEOUT, 5000);
>
> Many thanks in advance
>
> Russell
>
It is OK.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org