hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: MultiThreadedHttpConnectionManager - How it works
Date Tue, 19 Jul 2005 16:18:02 GMT
On Tue, Jul 19, 2005 at 12:58:32PM -0300, Bruno Borges wrote:
>    I'm wondering if some of you could clear some doubts I have about
> HttpClient, specially the MultiThreadedHttpConnectionManager class. If
> you can't, please stop reading this e-mail and press the Delete
> button. :)
> 
>   ...
> 
>   Well, thanks for your attention and your time.
>   I'm developing a tool that access several pages and extract
> informations the client needs, and to do that, I'm using HttpClient
> 3.0rc3. So I created a pool of Services (classes that push some kind
> of information from somewhere) and for each service there is one
> HttpClient instance.
>   Looking at the source code, I discover a special note about RFC
> 2616, that explains about how many connections can be open to the same
> host, and that limit's up to 2 connections.
>   So, here I go. Each HttpClient with its own MTHCM will function like
> one browser instance and running all Services I need will produce a
> clean result without any problem, or, can I optimize and use only one
> MTHCM's instance for all Service's HttpClient setting more than 2
> connections per host ?

Bruno,

In fact you'll be much better off using only one instance of HttpClient
and allocating separate HttpState and HostConfiguration instances per 
service / execution thread. When used with a thread-safe connection
manager such as MTHCM HttpClient is fully thread-safe

Oleg

> 
> 
> -- 
> Bruno Borges - SCJP 1.4
> bruno.borges@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message