hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: A question about ConnectTimeout and SoTimeout
Date Mon, 25 Aug 2014 11:42:28 GMT
On Sun, 2014-08-24 at 12:07 +0800, whybert wrote:
> Hi,
>      I am evaluating HTTP Async client and have following questions.
> 
> 
> There are two ways to set ConnectTimeout and SoTimeout in official examples: 
>         // Create I/O reactor configuration
>         IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
>                 .setIoThreadCount(Runtime.getRuntime().availableProcessors())
>                 .setConnectTimeout(30000)
>                 .setSoTimeout(30000)
>                 .build();
>         RequestConfig requestConfig = RequestConfig.copy(defaultRequestConfig)
>                 .setSocketTimeout(5000)
>                 .setConnectTimeout(5000)
>                 .setConnectionRequestTimeout(5000)
>                 .build();
> What's the difference between the two ways? 

Consider I/O reactor configuration to be global defaults some which can
overridden at the request level.

> And I find the IOReactorConfig.custom().setConnectTimeout() doesn't seem to work.

I can see the default connecting I/O reactor impl clearly making use of
this parameter. Could you please make sure you are not overriding the
I/O reactor defaults at the request level?

Oleg



---------------------------------------------------------------------
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