On Tue, 2008-05-13 at 17:36 -0700, Sujith Joseph wrote: > Hi, > I would like to know whether it is necessary to invoke > httpClient.getConnectionManager(). closeIdleConnections(1000), after > creating > 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 > MultiThreadedConnectionManager).
That basically means you are telling HttpClient to close connections that have been idle for 1000 ms. I am not sure that is what you want. > > If I am creating a httpClient instance (without using > MutliThreadedConnectionManager), Does a SimpleHttpConnectionManager gets > created for each httpClient creation behind the scenes. > Yes, it does. > Can I perform a type cast like this > ((SimpleHttpConnectionManager)httpClient.getConnectionManager).shutdown() to > ensure complete release of connections. > Yes, you can. Moreover, you really should. > 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 > state. > You _should_ shut down the connection manager if you no longer need it and want to ensure it releases all resources it currently holds > Can I re-use the same httpClient instance to perform http method executions, > if I am not using a multi-threaded Connection Manager? > Absolutely. Oleg > > Thanks, > Sujith --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
