hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "风" <304611...@qq.com>
Subject 回复: A question about the timeout of httpclient
Date Mon, 28 Jul 2014 09:29:07 GMT
thanks Oleg.
I am not really know how to fix my code. Please tell me how to fix my code to solve the problem.

------------------ 原始邮件 ------------------
发件人: "Oleg Kalnichevski";<olegk@apache.org>;
发送时间: 2014年7月28日(星期一) 下午5:19
收件人: "HttpClient User Discussion"<httpclient-users@hc.apache.org>; 

主题: Re: A question about the timeout of httpclient

On Mon, 2014-07-28 at 15:22 +0800, 风 wrote:
> i have set the timeout of the httpclient, code is here:
> RequestConfig config = RequestConfig.custom()
> 				    .setSocketTimeout(120000)
> 				    .setConnectTimeout(120000)
> 				    .setConnectionRequestTimeout(120000)
> 				    .build();
> httpclient = HttpClients.custom()
> 				.setDefaultRequestConfig(config)
> 				.setRedirectStrategy(myRedirectStrategy)
> 				.setRoutePlanner(routePlanner)
> 				.build();‍
> But when i call httpclient.execute(), it will still block here so long time great than
120000 milisecond.
> why the timeout is not effective? please help!

This is because socket timeout defines a maximum period of inactivity
between two consecutive read operations, and not an absolute operation

Hope this helps


To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message