Skip to content

okhttp / okhttp3 / Dispatcher / maxRequestsPerHost

maxRequestsPerHost

var maxRequestsPerHost:Int

The maximum number of requests for each host to execute concurrently. This limits requests by the URL’s host name. Note that concurrent requests to a single IP address may still exceed this limit: multiple hostnames may share an IP address or be routed through the same HTTP proxy.

If more than maxRequestsPerHost requests are in flight when this is invoked, those requests will remain in flight.

WebSocket connections to hosts do not count against this limit.

Getter

The maximum number of requests for each host to execute concurrently. This limits requests by the URL’s host name. Note that concurrent requests to a single IP address may still exceed this limit: multiple hostnames may share an IP address or be routed through the same HTTP proxy.

If more than maxRequestsPerHost requests are in flight when this is invoked, those requests will remain in flight.

WebSocket connections to hosts do not count against this limit.