Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B6FB5200B27 for ; Wed, 22 Jun 2016 15:28:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B57B5160A6A; Wed, 22 Jun 2016 13:28:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0A19C160A36 for ; Wed, 22 Jun 2016 15:28:58 +0200 (CEST) Received: (qmail 23484 invoked by uid 500); 22 Jun 2016 13:28:58 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 23450 invoked by uid 99); 22 Jun 2016 13:28:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2016 13:28:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 045D32C1F5D for ; Wed, 22 Jun 2016 13:28:58 +0000 (UTC) Date: Wed, 22 Jun 2016 13:28:58 +0000 (UTC) From: "Oleg Golovanov (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCLIENT-1751) HttpConnection -> close/shutdown -> does not work? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 22 Jun 2016 13:28:59 -0000 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15344303#comment-15344303 ] Oleg Golovanov commented on HTTPCLIENT-1751: -------------------------------------------- Oleg, i still don't get something. >> If you want to be able to manipulate connections kept alive in the pool you should be using the connection manager APIs What APIs you are taking about? I don't see anything related to connection closing except closeIdleConnections() and closeExpiredConnections() methods. >> as long as the connection is still bound to the response / request object. Could you explain, please, when connection is bound to request / response? >> One can use CloseableHttpResponse#close What i am doing wrong? I still see, that connection is reused ... HttpUriRequest request = new HttpGet("http://test-url.com/"); CloseableHttpResponse response = httpClient.execute(request); EntityUtils.toByteArray(response.getEntity()); response.close(); response = httpClient.execute(request); EntityUtils.toByteArray(response.getEntity()); response.close(); ------------------ Thank you. > 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: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org