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 HttpClient?

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

Cheers

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to