hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: Questions related to the use of HttpClient classes
Date Fri, 06 Jun 2003 12:37:22 GMT
> Yes, but recommendation says 2-3 connections per host/server..
> and I don't know the number of simultaneous connections, nor the peak,
> what about changing it at runtime?.

Yes, this is the recommend number according to the RFC.  But, depending 
on your application, it may make sense to change this.  Changing this 
value at runtime is probably not the best idea but it should work.

> finally I did a HttpClientPool with singleton 
> SimpleHttpConnectionManager
> with a Factory but I'm not sure if the SimpleHttpConnectionManager can
> actually  be Singleton or not.
>
> //private MultiThreadedHttpConnectionManager mtcm = null;
>   private SimpleHttpConnectionManager stcm=null;
>   protected HttpClientFactory() {
>    // mtcm = new MultiThreadedHttpConnectionManager();
>     stcm= new SimpleHttpConnectionManager();
>   }
>  public Object newInstance() {
>     log.debug("Creation of a new Client!");
>     return new HttpClient(stcm/*this.mtcm*/);
>   }
>
You definitely do not want to share an instance of 
SimpleHttpConnectionManager.  It only has a single connection and will 
give it to any code that asks for it, regardless of if it's already 
being used.

Mike


Mime
View raw message