hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Krugler <kkrugler_li...@transpac.com>
Subject Re: Increase the timeout
Date Fri, 12 Mar 2010 16:42:02 GMT

On Mar 12, 2010, at 7:15am, <ext-johan.groth@nokia.com> <ext-johan.groth@nokia.com

 > wrote:

> On 12/03/2010 14:56, "ext Ken Krugler" <kkrugler_lists@transpac.com>  
> wrote:
>
> When you create the DefaultHttpClient, you can specify an HttpParams
> parameter that contains configuration information, including various
> timeout values.
>
> See http://hc.apache.org/httpcomponents-client/tutorial/html/connmgmt.html#d4e391
>
> And also http://hc.apache.org/httpcomponents-core/httpcore/apidocs/org/apache/http/params/HttpConnectionParams.html
>
> A typical snippet looks like:
>
>             HttpParams params = new BasicHttpParams();
>             ....
>             HttpConnectionParams.setSoTimeout(params, _socketTimeout);
>             HttpConnectionParams.setConnectionTimeout(params,
> _connectionTimeout);
>             ....
>             ThreadSafeClientConnManager cm = new
> ThreadSafeClientConnManager(params, schemeRegistry);
>             _httpClient = new DefaultHttpClient(cm, params);
>
>
> Thanks for your reply. I wonder one this though, will the default  
> params in DefaultHttpClient be overwritten by params or are they  
> added?

If you're talking about the per-request params you can add, then they  
should override whatever default parameters you've specified when  
creating the HttpClient instance.

The HttpClient 4.0 tutorial has some extensive information about  
configuration management.

-- Ken

--------------------------------------------
Ken Krugler
+1 530-210-6378
http://bixolabs.com
e l a s t i c   w e b   m i n i n g





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


Mime
View raw message