org.apache.commons.httpclient.HttpClient.setConnectionTimeout()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.apache.commons.httpclient.HttpClient.setConnectionTimeout()方法的一些代码示例,展示了HttpClient.setConnectionTimeout()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpClient.setConnectionTimeout()方法的具体详情如下:
包路径:org.apache.commons.httpclient.HttpClient
类名称:HttpClient
方法名:setConnectionTimeout

HttpClient.setConnectionTimeout介绍

[英]Sets the timeout until a connection is etablished. A value of zero means the timeout is not used. The default value is zero.
[中]设置超时,直到连接被重新设置。值为零表示不使用超时。默认值为零。

代码示例

代码示例来源:origin: tracee/tracee

@Override
@SuppressWarnings("deprecation")
public synchronized void setConnectionTimeout(int newTimeoutInMilliseconds) {
  delegate.setConnectionTimeout(newTimeoutInMilliseconds);
}

代码示例来源:origin: edu.ucar/netcdf

public void setConnectionTimeout(int timeout)
{
  sessionClient.setConnectionTimeout(timeout);
}

代码示例来源:origin: approvals/ApprovalTests.Java

/***********************************************************************/
public InputStream getResponse(HttpClient client, PostMethod post) throws HttpException, IOException
{
 //    My_System.markerIn();
 //    My_System.variable(post.getURI().toString());
 //    My_System.variable("parameters", post.getParameters());
 client.setConnectionTimeout(30000);
 client.setTimeout(30000);
 client.executeMethod(post);
 InputStream r = post.getResponseBodyAsStream();
 //    My_System.markerOut();
 return r;
}
/***********************************************************************/

代码示例来源:origin: apache/roller

client.setConnectionTimeout(45 * RollerConstants.SEC_IN_MS);
HttpMethod method = new PostMethod(trackbackURL);
method.setQueryString(queryString);

相关文章