* Builds the {@link HttpClient}.
*
* @return an {@link HttpClient}
*/
public HttpClient build(String name, UrsusHttpClientConfiguration configuration) {
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
setStrategiesForClient(httpClientBuilder, configuration);
SocketConfig socketConfig = SocketConfig.copy(SocketConfig.DEFAULT)
.setSoTimeout(configuration.getTimeout())
.setTcpNoDelay(true)
.setSoReuseAddress(true).build();
ConnectionConfig connectionConfig = ConnectionConfig.copy(ConnectionConfig.DEFAULT)
.setBufferSize(configuration.getBufferSize()).build();
httpClientBuilder.setDefaultSocketConfig(socketConfig);
httpClientBuilder.setDefaultConnectionConfig(connectionConfig);
return httpClientBuilder.build();
}