OkHttp how to set maximum connection pool size (not max idle connections)
问题 In OkHttp I cannot find a way to set a hard maximum connection pool size. From the documentation https://square.github.io/okhttp/3.x/okhttp/okhttp3/ConnectionPool.html it is clear that you can set a maximum idle connections, but not an overall max. That means that with high load it can grow beyond any limit. Is there a way to maximize the pool? If not, why not? 回答1: Connections are either active and held by a particular in-flight call, or idle and in the pool. Limit the total number of