You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Aegir Sun <Ae...@Sun.COM> on 2005/09/19 12:28:42 UTC

How to set the maxConnectionsPerHost parameter?

Hi,

I want to set the maxConnectionsPerHost parameter to 5 for
MultiThreadedHttpConnectionManger. The default value is 2, and
that value is too small for me.

I use the method as below:
/connectionManager.setMaxConnectionsPerHost(10);

/But it seems to be no use. So how can I adjust the value for
maxConnectionsPerHost parameter?

Thanks very much for your help.

Regards,
Aegir

Re: How to set the maxConnectionsPerHost parameter?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, Sep 19, 2005 at 06:28:42PM +0800, Aegir Sun wrote:
> Hi,
> 
> I want to set the maxConnectionsPerHost parameter to 5 for
> MultiThreadedHttpConnectionManger. The default value is 2, and
> that value is too small for me.
> 
> I use the method as below:
> /connectionManager.setMaxConnectionsPerHost(10);
> 
> /But it seems to be no use. So how can I adjust the value for
> maxConnectionsPerHost parameter?
> 
> Thanks very much for your help.
> 
> Regards,
> Aegir

Aegir,

I think this should do the trick:

MultiThreadedHttpConnectionManager connman = new MultiThreadedHttpConnectionManager();
connman.getParams().setDefaultMaxConnectionsPerHost(10);
HttpClient httpagent = new HttpClient(connman);

Oleg




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