List of usage examples for org.apache.http.impl.nio.client HttpAsyncClientBuilder setDefaultConnectionConfig
public final HttpAsyncClientBuilder setDefaultConnectionConfig(final ConnectionConfig config)
From source file:com.baidubce.http.BceHttpClient.java
/** * Create asynchronous http client based on connection manager. * * @param connectionManager Asynchronous http client connection manager. * @return Asynchronous http client based on connection manager. *//* w w w.ja va 2 s . c om*/ protected CloseableHttpAsyncClient createHttpAsyncClient(NHttpClientConnectionManager connectionManager) { HttpAsyncClientBuilder builder = HttpAsyncClients.custom().setConnectionManager(connectionManager); int socketBufferSizeInBytes = this.config.getSocketBufferSizeInBytes(); if (socketBufferSizeInBytes > 0) { builder.setDefaultConnectionConfig( ConnectionConfig.custom().setBufferSize(socketBufferSizeInBytes).build()); } return builder.build(); }