You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Leo Galambos <lg...@hq.egothor.org> on 2010/03/23 16:22:26 UTC

HttpCore NIO: drop a connection intentionally

Hello,

I am trying to use HttpCore NIO for a deep web crawler. The crawler must
be able to cancel/drop a connection as soon as the respective data
stream length is above some limit (e.g. 10MB). Obviously, I have no
intentions of fetching ISO/DVD images...

AFAIK I would implement my own BufferingNHttpEntity-like class to detect
the limit condition. The problem is that I am not sure how to deliver
the "cancel" signal to upper-layer classes (via IOControl::shutdown?).

What is the correct way to implement the described feature?

Thank you,
LG

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


Re: HttpCore NIO: drop a connection intentionally

Posted by Oleg Kalnichevski <ol...@apache.org>.
Leo Galambos wrote:
> Hello,
> 
> I am trying to use HttpCore NIO for a deep web crawler. The crawler must
> be able to cancel/drop a connection as soon as the respective data
> stream length is above some limit (e.g. 10MB). Obviously, I have no
> intentions of fetching ISO/DVD images...
> 
> AFAIK I would implement my own BufferingNHttpEntity-like class to detect
> the limit condition. The problem is that I am not sure how to deliver
> the "cancel" signal to upper-layer classes (via IOControl::shutdown?).
> 
> What is the correct way to implement the described feature?
> 

IOControl#shutdown() should do the trick, but in your particular case 
you may also want to consider writing your own NHttpClientHandler 
implementation in order to have a complete control over the protocol 
handling.

Hope this helps

Oleg


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


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