'How to limit connections for java.net.http.HttpClient

How to limit the number of connection/request for java.net.http.HttpClient?

I see I can set an Executor to HttpClient but I don't know: if I limit the number of thread in pool of Executor, is it limit also the number of connection?

Another way to limit the number of connection?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source