List of usage examples for org.apache.commons.httpclient SimpleHttpConnectionManager closeIdleConnections
public void closeIdleConnections(long paramLong)
From source file:cn.leancloud.diamond.client.processor.ServerAddressProcessor.java
private void initHttpClient() { HostConfiguration hostConfiguration = new HostConfiguration(); SimpleHttpConnectionManager connectionManager = new SimpleHttpConnectionManager(); connectionManager.closeIdleConnections(5000L); HttpConnectionManagerParams params = new HttpConnectionManagerParams(); params.setStaleCheckingEnabled(diamondConfigure.isConnectionStaleCheckingEnabled()); params.setConnectionTimeout(diamondConfigure.getConnectionTimeout()); connectionManager.setParams(params); configHttpClient = new HttpClient(connectionManager); configHttpClient.setHostConfiguration(hostConfiguration); }