j***@redhat.com
2018-11-05 15:56:53 UTC
Hi,
I am attempting to use the client API. Following the documentation to
combine....
Pooling Connection Manager
+
Multithreaded request execution
+
keep-alive
+
re-use socket address
I want to know how the api should be used to re-use the underlying
socket. With the aim to avoid sockets in CLOSE_WAIT waiting to timeout.
My use case is using httpcomponents to benchmark a server.
The example code in 2.4. Multithreaded request execution shows the
CloseableHttpResponse.close() method being called. I find this closes
the socket on the managed connection respone. That's because
org.apache.http.impl.execchain.ConnectionHolder.close() releases the
managed connection but ignores the configured boolean value of
ConnectionHolder.reusable.
Avoiding the call to CloseableHttpResponse.close() means the
underlying connection is never released to the pool.
To me this seems broken.
I'd expect to find a visible releaseConnection method on the response
object. The body honouring how to handle the underlying resources and
the managed connection released to the pool.
I looked for an example but found none. How is this supposed to work ?
Regards,
Jeremy Whiting
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org
I am attempting to use the client API. Following the documentation to
combine....
Pooling Connection Manager
+
Multithreaded request execution
+
keep-alive
+
re-use socket address
I want to know how the api should be used to re-use the underlying
socket. With the aim to avoid sockets in CLOSE_WAIT waiting to timeout.
My use case is using httpcomponents to benchmark a server.
The example code in 2.4. Multithreaded request execution shows the
CloseableHttpResponse.close() method being called. I find this closes
the socket on the managed connection respone. That's because
org.apache.http.impl.execchain.ConnectionHolder.close() releases the
managed connection but ignores the configured boolean value of
ConnectionHolder.reusable.
Avoiding the call to CloseableHttpResponse.close() means the
underlying connection is never released to the pool.
To me this seems broken.
I'd expect to find a visible releaseConnection method on the response
object. The body honouring how to handle the underlying resources and
the managed connection released to the pool.
I looked for an example but found none. How is this supposed to work ?
Regards,
Jeremy Whiting
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-***@hc.apache.org
For additional commands, e-mail: httpclient-users-***@hc.apache.org