commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Mathieu <mathi...@zoe.cea.fr>
Subject Re: [httpclient] MultiThreadedHttpConnectionManager : connections available
Date Fri, 11 Apr 2003 07:25:04 GMT
Hi Adrian,

thanks for your explanations, i misunderstood the bug Mike is fixing.

Let's me give you some details about how I use HttpClient in my project:
I have a server which is provided with a list of URL to retrieve, this urls 
are given by other threads, asynchronously, and the server have to process 
Http requests and store results into files. I use a thread pool to process 
those requests. Of course, as httpClient does, the number of connection for a 
host is limited, so i'd like to know which connections are available in order 
not to have threads wasting time waiting for connections ... I don't know if 
this kind of use honor the contracts of usage that HttpClient applies, but to 
me, it seems that httpClient would suit well my needs ;-)

The solution I choosed for the moment, is to extends 
MultiThreadedHttpConnectionManager by adding a non blocking version of 
getConnection() (which is very simple to write since it is the same as the 
blocking one, without timeOut and wait() ). When there is requests to process 
and a thread available, i try to get connections, and provide the thread with 
the first one i get. It seems to works until now ...

As you wrote, after a while my program is running out of memory. It may be 
because of the number of connections, so I'll try with the next version.

Thanks to the httpClient team, for their time, and their quality development 
;-)

Benoit

Mime
View raw message