hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sujith Joseph" <sujithjos...@gmail.com>
Subject Regarding closing of idle connections for non-reusable / non-threaded httpClient instances to ensure complete connection closure
Date Wed, 14 May 2008 00:36:58 GMT
     I would like to know whether it is necessary to invoke
httpClient.getConnectionManager(). closeIdleConnections(1000), after
an httpClient (httpClient = new HttpClient()), creating an httpmethod,
executing the httpmethod  and performing method.releaseConnection(), to
ensure that the http connections are properly closed, since I am creating an
httpClient instance for each and every http request (since I am not using

If I am creating a httpClient instance (without using
MutliThreadedConnectionManager), Does a SimpleHttpConnectionManager gets
created for each httpClient creation behind the scenes.

Can I perform a type cast like this
((SimpleHttpConnectionManager)httpClient.getConnectionManager).shutdown() to
ensure complete release of connections.

 If I am not using the httpClient instance anymore after executing a http
method request, do you recommend closing off idle connections / shut down
ConnectionManager, to avoid creation of too many open sockets in CLOSE_WAIT

Can I re-use the same httpClient instance to perform http method executions,
if I am not using a multi-threaded Connection Manager?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message