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: Safe close of connection with partial read of response
Date Tue, 04 Aug 2009 09:20:24 GMT
On Mon, Aug 03, 2009 at 02:51:06PM -0700, Ken Krugler wrote:
> BTW, I did read the section titled "Ensuring release of low level  
> resources" on the 
> http://hc.apache.org/httpcomponents-client/tutorial/html/fundamentals.html 
>  page. This recommends using abort() to clean things up, but that would 
> seem to kill the keep-alive connection.
>
> So a better way to ask my question is whether there's any approach that 
> keeps the connection alive, without consuming all of the content. I'm 
> thinking the answer is no, but I wanted to confirm.
>

I confirm this is not possible.

Oleg

> Thanks,
>
> -- Ken
>
> ==================== 
> ========================================================================
> I'm trying to keep connections alive so that I can more efficiently load 
> a set of pages from one web server domain.
>
> I also don't always read the complete response, to avoid having some 1GB 
> renegade file from a web server fill up memory.
>
> So if I truncate the response by not reading all of it, what's the safe 
> approach to make sure there aren't residual bytes in the server's buffer 
> that will get passed back in a subsequent request? Or is that even a 
> possibility?
>
> Currently I'm just closing the response.getEntity().getContent()  
> InputStream.
>
> --------------------------
> Ken Krugler
> TransPac Software, Inc.
> <http://www.transpac.com>
> +1 530-210-6378
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message