Hi Satya,
Sorry for the slow response... The number of connections in use does not get decremented in this case as no connections are actually being destroyed. The connection manager still holds references to the same number of connections after closeIdleConnections() is called. connectionsInUse is meant to detail the number of connections that have been allocated, not the number that are open. Given these semantics the behavior is correct I believe.
The next question is if this makes sense. I see two possibilities here:
1) Document getConnectionsInUse() to better describe the current behavior.
2) Change closeIdleConnections() to delete closed connections. This will require changes to the IdleConnectionHandler, so that we know which connections are closed.
Any suggestions or preferences?
Mike
On May 27, 2004, at 5:27 PM, [EMAIL PROTECTED] wrote:
After Calling
MultiThreadedHttpConnectionManager.closeIdleConnections(idleTime), the timedout connections are closed, however, connectinon count does not decrease.
Therefore, if I call MultiThreadedHttpConnectionManager.getConnectionsInUse(), I still get the same value as before calling closeIdleConnections(). After a bit of code browsing the problem seems to be in the following code:
public synchronized void closeIdleConnections(long idleTimeout) {
idleConnectionHandler.closeIdleConnections(idleTimeout);
}
Which does not decrease the number of connections after actually removing them.
The code should be:
public synchronized void closeIdleConnections(long idleTimeout) {
idleConnectionHandler.closeIdleConnections(idleTimeout);
//Now do the connection accounting (Pseudo code) numConnections = idleConnectionHandler.getConnectionsCount();
//Also adjust the hostPool.numConnections } Any taker? --Satya
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]