I want to start an async GET request for a big file. Then, at some point, while 
the content is still being received, I would like to cancel the request from 
another thread and close all relevant resources.

I tried to achieve this behaviour by implementing AsyncByteConsumer and doing 
something like the following, but I have the feeling that the connection from 
the connection pool was not released:

…
        @Override
        protected void onByteReceived(ByteBuffer buf, IOControl ioctrl) throws 
IOException {
                …
                ioctrl.shutdown();
                …
        }
…

Also, I read in documentation that using “shutdown” on a channel is bad for SSL 
connections, where “close” should be called instead.

Thanks,
Yoram
On February 17, 2014 at 11:16:03 AM, Oleg Kalnichevski ([email protected]) wrote:

On Sun, 2014-02-16 at 16:30 +0200, Yoram Dayagi (Gmail) wrote:  
> Hi  
> I would like to use HttpAsyncClient in order to execute async requests.  
> Is it possible to abort an executing request from another thread?  
>  

What exactly do you mean by aborting request execution? Unblocking a  
thread awaiting on the result future? Shutting down the underlying  
connection? What is it exactly you are trying to achieve?  

Oleg  



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

Reply via email to