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 > [EMAIL PROTECTED] > > --------------------------------------------------------------------- > 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]
