类 ConnectionPool
java.lang.Object
com.lark.oapi.okhttp.ConnectionPool
Manages reuse of HTTP and HTTP/2 connections for reduced network latency. HTTP requests that
share the same
Address may share a Connection. This class implements the policy
of which connections to keep open for future use.-
构造器概要
构造器构造器说明Create a new connection pool with tuning parameters appropriate for a single-user application.ConnectionPool(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit) -
方法概要
修饰符和类型方法说明intReturns total number of connections in the pool.voidevictAll()Close and remove all idle connections in the pool.intReturns the number of idle connections in the pool.
-
构造器详细资料
-
ConnectionPool
public ConnectionPool()Create a new connection pool with tuning parameters appropriate for a single-user application. The tuning parameters in this pool are subject to change in future OkHttp releases. Currently this pool holds up to 5 idle connections which will be evicted after 5 minutes of inactivity. -
ConnectionPool
-
-
方法详细资料
-
idleConnectionCount
public int idleConnectionCount()Returns the number of idle connections in the pool. -
connectionCount
public int connectionCount()Returns total number of connections in the pool. -
evictAll
public void evictAll()Close and remove all idle connections in the pool.
-