hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adr...@intencha.com>
Subject Re: MultiThreadedHttpConnectionManager Questions
Date Thu, 10 Apr 2003 03:54:48 GMT
Hi Mike,

> This method looks a little suspicious at first I agree.  Though, as it 
> turns out the HttpException is only thrown when a connection wait 
> timeout occurs.  In the case of  getConnection(HostConfiguration) this 
> will  never occur since we are waiting indefinitely.  The 
> try/catch/loop is just there to make the compiler happy, and the LOG 
> statement was added for completeness.  I have added a comment 
> detailing this to my latest patch for bug 18596.

Thanks Mike, I figured it had to be something like that but just 
couldn't verify it completely.

>> Secondly, an enquiry came through regarding how to determine the 
>> number of "connections available" (where "connections available" 
>> means free connections + connections that can be created before 
>> reaching maxConnections).  I suggested:
>>
>> manager.getMaxConnectionsPerHost() - 
>> manager.getConnectionsInUse(hostConfiguration);
>>
>> However the proposed patch for bug 18596 makes this more complex.  So 
>> could there be a request for a method that determines how many 
>> connections can be made gets added?
>
> The patch for 18596 has methods for getting the max number of 
> connections and the total number in use.  Are you also wondering how 
> many idle connections there are?

No, the question seems to be: how many more methods can I execute 
without having to wait for another connection to become available?  We 
the current code in CVS the answer is simply total allowed connections 
for the hose - the connections in use for the host.  With the new code 
you also have to take into consideration the total number of 
connections for any host.  So it becomes Math.min(maxTotal - 
inUseTotal, maxHost - inUseHost); which could be implemented outside of 
the connection manager but it may be worth adding a convenience method. 
  I'm not at all concerned whether or not it goes in, rather just 
passing on a user request.

> Mike

Thanks for the info,

Adrian.


Mime
View raw message