Skip to content

okhttp / okhttp3 / ConnectionPool


class 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.


Name Summary
<init> ConnectionPool(maxIdleConnections:Int, keepAliveDuration:Long, timeUnit:TimeUnit)


Name Summary
connectionCount Returns total number of connections in the connectionCount():Int
evictAll Close and remove all idle connections in the evictAll():Unit
idleConnectionCount Returns the number of idle connections in the idleConnectionCount():Int