hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Fernandes <donal...@gmail.com>
Subject help with EofSensorInputStream..
Date Wed, 20 Apr 2011 13:00:00 GMT

I have recently moved from Httpclient 3.1 to HttpClient 4.2, mainly to
resolve the inputstream autoclose problem. I need help in creating the

I have a http connection pool amanager using ThreadSafeClientConnManager

when i post an url and get the response using getEntity().getContent() i
believe this method by default closes the stream. and to override this we
need to use the EofSensorInputStream

I'm facing problems in creating the constructor for the same, because it
take ManagedClientConnection as a parameter and i cannot Cast this to

THe only way i see , i can use this is by using BasicEofSensorWatcher..but
the constructor is a tedious process. 

EofSensorWatcher watcher  = new BasicEofSensorWatcher(new
BasicPooledConnAdapter(httpConnectionPoolMgr.getMgr(), new BasicPoolEntry
					(new DefaultClientConnectionOperator(new SchemeRegistry()), new
HttpRoute(new HttpHost("hostname")))) , false );

EofSensorInputStream result = new
EofSensorInputStream(status.getEntity().getContent(), watcher);

But this also gives me a compilation problems. Is there any easier way i can
use this? any help here would be really appreciated. 

View this message in context: http://old.nabble.com/help-with-EofSensorInputStream..-tp31441020p31441020.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

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

View raw message