|
|
|
@ -149,8 +149,6 @@ public class HTTPClient {
|
|
|
|
|
builder.setConnectTimeout(default_timeout);
|
|
|
|
|
// SO_TIMEOUT: maximum period inactivity between two consecutive data packets in milliseconds
|
|
|
|
|
builder.setSocketTimeout(default_timeout);
|
|
|
|
|
// getting an I/O error when executing a request over a connection that has been closed at the server side
|
|
|
|
|
builder.setStaleConnectionCheckEnabled(true);
|
|
|
|
|
// ignore cookies, cause this may cause segfaults in default cookiestore and is not needed
|
|
|
|
|
builder.setCookieSpec(CookieSpecs.IGNORE_COOKIES);
|
|
|
|
|
builder.setRedirectsEnabled(true);
|
|
|
|
@ -209,7 +207,7 @@ public class HTTPClient {
|
|
|
|
|
// Increase max connections for localhost
|
|
|
|
|
final HttpHost localhost = new HttpHost(Domains.LOCALHOST);
|
|
|
|
|
pooling.setMaxPerRoute(new HttpRoute(localhost), maxcon);
|
|
|
|
|
|
|
|
|
|
pooling.setValidateAfterInactivity(default_timeout); // on init set to default 5000ms
|
|
|
|
|
final SocketConfig socketConfig = SocketConfig.custom()
|
|
|
|
|
// Defines whether the socket can be bound even though a previous connection is still in a timeout state.
|
|
|
|
|
.setSoReuseAddress(true)
|
|
|
|
|