[
https://issues.apache.org/jira/browse/HTTPCLIENT-1751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15344353#comment-15344353
]
Oleg Kalnichevski commented on HTTPCLIENT-1751:
-----------------------------------------------
bq. What APIs you are taking about? I don't see anything related to connection
closing except closeIdleConnections() and closeExpiredConnections() methods.
Yes, I am but also about {{ConnectionReuseStrategy}} and
{{ConnectionKeepAliveStrategy}} strategies
bq. Could you explain, please, when connection is bound to request / response?
Through
[ConnectionHolder|https://github.com/apache/httpclient/blob/4.5.x/httpclient/src/main/java/org/apache/http/impl/execchain/ConnectionHolder.java]
that will trigger connection release as soon as response content has been
fully consumed or response processing gets aborted.
bq. What i am doing wrong?
See above. {{EntityUtils.toByteArray(response.getEntity())}} triggers
connection release.
Oleg
> HttpConnection -> close/shutdown -> does not work?
> --------------------------------------------------
>
> Key: HTTPCLIENT-1751
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1751
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.5.2
> Reporter: Oleg Golovanov
>
> I am looking for a way to close connections manually, using httpclient with
> pooling connection manager.
> Why do i need it?
> I'll explain.
> 1) i am executing request
> 2) request successfully executed, no I/O error, connection kept-alive
> 3) i analyze response and understand, that i don't need that connection at
> all.
> Right not its in ESTABLISHED state, and i want to close it as soon as
> possible.
> I don't want to wait for that connection to be closed by, for example,
> connectionManager.closeIdleConnections() method.
> Is it possible?
> I am getting HttpConnection object via context.getConnection(), but "close"
> and "shutdown" does not do anything, connection still alive after that.
> And one more question:
> is it possible somehow to get connection's local socket address + remote
> socket address using HttpClient?
> I need that information for debugging network.
> Thank you.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]