0

I'm using Apache HttpClient 4.3.x and was wondering if there's a way too see what is the current value for the socket buffer size used by it to send/receive data and if it's possible for me to change it?

daniels
  • 17,788
  • 30
  • 99
  • 168

1 Answers1

1

I have not found a way to see the current value, but if you haven't provided a ConnectionConfig when building your HttpClient, it uses ConnectionConfig.DEFAULT which has a bufferSize of 8192.

You can specify a custom buffer size when building your HttpClient. For example,

int bufferSize = 42;
ConnectionConfig config = ConnectionConfig.custom().setBufferSize(bufferSize).build();

CloseableHttpClient httpClient = HttpClientBuilder.create()
                                    .setDefaultConnectionConfig(config)
                                    .build();
Sotirios Delimanolis
  • 263,859
  • 56
  • 671
  • 702