hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Httpcomponents Wiki] Update of "HttpClientTutorial" by OlegKalnichevski
Date Sun, 15 Mar 2009 12:05:15 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpcomponents Wiki" for change notification.

The following page has been changed by OlegKalnichevski:
http://wiki.apache.org/HttpComponents/HttpClientTutorial

------------------------------------------------------------------------------
  
  === Ensuring release of low level resources ===
  
-    When finished with a response entity, it's important to ensure that all entity content
has been fully consumed. The easiers way to do so is to call the HttpEntity#consumeContent()
method to consume any available content on the stream, so the connection could be safely released
to the connection pool and re-used by the connection manager for subsequent requests. 
+    When finished with a response entity, it's important to ensure that all entity content
has been fully consumed, so that the connection could be safely returned to the connection
pool and re-used by the connection manager for subsequent requests. The easiest way to do
so is to call the HttpEntity#consumeContent() method to consume any available content on the
stream. HttpClient will automatically release the underlying connection back to the connection
manager as soon as it detects that the end of the content stream has been reached. The HttpEntity#consumeContent()
method is safe to call more than once.
  
     There can be situations, however, when only a small portion of the entire response content
needs to be retrieved and the performance penalty for consuming the remaining content and
making the connection reusable is too high, one can simply terminate the request by calling
HttpUriRequest#abort() method.
     

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


Mime
View raw message