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: Trouble with eof-of-file sensing
Date Sun, 14 Nov 2010 12:01:37 GMT
On Sat, 2010-11-13 at 22:00 +0100, Sebastiano Vigna wrote:
> I'm getting literally crazy trying to figure out if and when HttpClient has closed the
connection stream automatically.
> 
> The behaviour existed in 3.1 (AutoCloseInputStream), and I found indications that HttpClient
4 had solved the problem... well, no. Now it's called EofSensorWatcher, but the problem is
the same: you perform a read() and instead of -1 you get an exception.
> 
> My question is: how can I know whether the InputStream content of an Entity returned
by a response has been closed automatically? 

EofSensorInputStream class automatically releases the underlying input
stream as soon as it gets -1 from a read operation. All subsequent read
operations will always return -1. The EofSensorInputStream will not
throw an exception on a read operation as long as it has not been
explicitly closed with #close() method.


> I'm getting spurious IOExceptions everywhere. Unfortunately, nobody seems to have the
problem--I couldn't find any relevant information by Googling around.
> 

What kind of spurious IOExceptions are you getting?

Oleg


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