Discussion:
Confused about PoolingHttpClientConnectionManager's mechanism
安 琦
2018-09-18 02:38:03 UTC
Permalink
Hi,

I'm using httpclient-4.5.5.

I used a single HttpClient instance with PoolingHttpClientConnectionManager.
When the execute() method finished,I called one of the methods response.close()/request.releaseConnection()/request.abortConnection() in the finally block.

However,no matter which method I called, I found ConnectionHolder#releaseConnection(false) would be invoked,and then the connection would be closed and discarded by the pool.

So I'm confused about the connection reusing mechanism.How does it work?

Thank you.

B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��[��X��ܚX�KK[XZ[��Y[� ]\�\��][��X��ܚX�P˘\X�K�ܙ�B��܈Y][ۘ[��[X[
Bernd Eckenfels
2018-09-18 10:06:14 UTC
Permalink
Hello,

Did you actually read/consumed everything of the InputStream and is this a HTTP/1.1 service with Keepalive?

Gruss
Bernd


Gruss
Bernd
--
http://bernd.eckenfels.net

________________________________
Von: °² çù <***@live.cn>
Gesendet: Dienstag, September 18, 2018 11:32 AM
An: httpclient-***@hc.apache.org
Betreff: Confused about PoolingHttpClientConnectionManager's mechanism

Hi,

I'm using httpclient-4.5.5.

I used a single HttpClient instance with PoolingHttpClientConnectionManager.
When the execute() method finished,I called one of the methods response.close()/request.releaseConnection()/request.abortConnection() in the finally block.

However,no matter which method I called, I found ConnectionHolder#releaseConnection(false) would be invoked,and then the connection would be closed and discarded by the pool.

So I'm confused about the connection reusing mechanism.How does it work?

Thank you.

B‹KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB??[œÝXœØܚX™KK[XZ[??Y[?]\Ù\œË][œÝXœØܚX™P˘\X?K›Ü™ÃB‘›ÜˆY][ۘ[ÛÛ[X[??K[XZ[??Y[?]\Ù\œËZ[˘\X?K›Ü™ÃBƒB
Loading...