hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joan Balagueró <joan.balagu...@grupoventus.com>
Subject RE: Socket timeout in the async http client
Date Fri, 07 Oct 2016 13:19:49 GMT
Hi Dmitry,

Thanks for the explanantion. It's clear now.

Joan.

-----Mensaje original-----
De: Dmitry Potapov [mailto:potapov.d@gmail.com] 
Enviado el: viernes, 7 de octubre de 2016 15:18
Para: HttpClient User Discussion
Asunto: Re: Socket timeout in the async http client

Hello Joan,

Async client works on reactor model, so timeouts being checked only between selects.
You can change interval between selects by using setSelectInterval function in IOReactorConfig
builder:
For example: IOReactorConfig.custom().setSelectInterval(100L).build();

Please be concern that reducing this value causes reactor threads to consume more CPU resources.

--
Dmitry

On Fri, Oct 07, 2016 at 03:03:44PM +0200, Joan Balagueró wrote:
> Hello,
> 
>  
> 
> I’m setting the socket timeout on my requests as follows:
> requestBuilder.setConfig(RequestConfig.copy(this.objHttp.getRequestCon
> fig()) .setSocketTimeout(responseTimeoutToSet).build());
> 
>  
> 
> I have double checked that the variable ‘responseTimeoutToSet’ has the 
> right value. So if I set up a socket timeout of 1000ms or 2000ms or 
> 3000ms, it works fine. But if I set up a socket timeout of 1200ms, the 
> exception is thrown after 2000ms. And if I set up a socket timeout of 
> 2400ms, the exception is thrown after 3000ms.
> 
>  
> 
> Is this right behaviour with the async client? The blocking client 
> respects strictly the socket timeout, but the async seems to skip from 
> 1 to 2 to 3 seconds …
> 
>  
> 
> Thanks,
> 
>  
> 
> Joan.
> 

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


Mime
View raw message