HttpClient 4 和 HttpClient 3 超时

HttpClient 4:

连接超时:

httpclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,60000);
// 或者
HttpConnectionParams.setConnectionTimeout(params, 6000);

读取超时:

httpclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT,60000);
// 或者
HttpConnectionParams.setSoTimeout(params, 60000);

HttpClient 3:

连接超时:

httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(60000);

读取超时:

httpClient.getHttpConnectionManager().getParams().setSoTimeout(60000);
上一篇:appium+robotframework常见技巧总结


下一篇:[MS bug]安装SQL Server 2008 错误:is not a valid login or you do not have permission