Hi Dmitry,

Thanks for the explanantion. It's clear now.

Joan.

-----Mensaje original-----
De: Dmitry Potapov [mailto:potapo...@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-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org




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

Reply via email to