
com.netease.cloud.http.ConnectionManagerFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nos-sdk-java-publiccloud Show documentation
Show all versions of nos-sdk-java-publiccloud Show documentation
nos java sdk to the Central Repository
package com.netease.cloud.http;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.HttpParams;
import com.netease.cloud.ClientConfiguration;
/** Responsible for creating and configuring instances of Apache HttpClient4's Connection Manager. */
class ConnectionManagerFactory {
public static ThreadSafeClientConnManager createThreadSafeClientConnManager( ClientConfiguration config, HttpParams httpClientParams ) {
ThreadSafeClientConnManager connectionManager = new ThreadSafeClientConnManager();
connectionManager.setDefaultMaxPerRoute(config.getMaxConnections());
connectionManager.setMaxTotal(config.getMaxConnections());
IdleConnectionReaper.registerConnectionManager(connectionManager);
return connectionManager;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy