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: Close/interrupt HTTP connections
Date Wed, 24 Nov 2010 21:19:42 GMT
On Wed, 2010-11-24 at 19:55 +0100, Roman Kennke wrote:
> Hello,
> I need to be able to close/interrupt an active connection. The only ways to achieve this,
as far as I understand it, is to:
> - Close the socket from a 2nd thread. This would throw a SocketConnection on the blocked
thread. In order to implement this, I would need to get a reference to the actual socket.
Is that possible?

This is precisely what HttpConnection#shutdown() does. Please also note
that HttpUriRequest#abort() is intended to abort the request at any
stage of execution (while leasing or opening a new connection or while
transmitting data). You do not really have to mess with sockets.

> - Interrupt the blocked thread. This is only possible when using NIO SocketChannels.
Is there a way to use HttpClient with NIO SocketChannel? I know that HttpCore supports this,
but then I don't easily get cookie and proxy support. Is there a way to hook this up into

I am currently working on an asynchronous version of HttpClient based on
HttpCore NIO.



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

View raw message