Example usage for org.apache.commons.httpclient.util IdleConnectionTimeoutThread setConnectionTimeout

List of usage examples for org.apache.commons.httpclient.util IdleConnectionTimeoutThread setConnectionTimeout

Introduction

In this page you can find the example usage for org.apache.commons.httpclient.util IdleConnectionTimeoutThread setConnectionTimeout.

Prototype

public void setConnectionTimeout(long paramLong) 

Source Link

Usage

From source file:com.boyuanitsm.pay.alipay.util.httpClient.HttpProtocolHandler.java

/**
 * ?//from  w ww .  jav  a2s  .  c om
 */
private HttpProtocolHandler() {
    // HTTP
    connectionManager = new MultiThreadedHttpConnectionManager();
    connectionManager.getParams().setDefaultMaxConnectionsPerHost(defaultMaxConnPerHost);
    connectionManager.getParams().setMaxTotalConnections(defaultMaxTotalConn);

    IdleConnectionTimeoutThread ict = new IdleConnectionTimeoutThread();
    ict.addConnectionManager(connectionManager);
    ict.setConnectionTimeout(defaultIdleConnTimeout);

    ict.start();
}