hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: How can I get access to underlying socket from HttpClient?
Date Thu, 04 Nov 2010 09:13:00 GMT
On Wed, 2010-11-03 at 12:31 -0400, Hemant Tiwari wrote:
> Hi,
> 
> I am using HttpClient for connecting to streaming server. At client side I
> am checking for server response and in case I get an unexpected response I
> am trying to close connection.
> 
> My question is
> 
> Is there any way for me to use or get access to socket to terminate my Http
> streaming (received as chunk data) from server.
> 

HttpClient makes intentionally difficult to have direct access to the
underlying HTTP connection. It is possible but strongly discouraged.

> Right now I was not able to locate a way to close a connection as
> inputstream.close() doesn't work. And streaming connection stays on till
> server does not close.
> 

Use HttpUriRequest#abort() method to shut down the underlying
connection.

hope this helps

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message