[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-commons-dev
Subject:    Connection Accounting Problem
From:       http-client () jrapid ! com
Date:       2004-05-27 21:27:39
Message-ID: 200405272127.i4RLRd208214 () ams004 ! lax ! affinity ! com
[Download RAW message or body]

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: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic