hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ext-johan.gr...@nokia.com>
Subject Re: Increase the timeout
Date Fri, 12 Mar 2010 15:15:31 GMT
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?

Regards,
Johan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message