PoolingClientConnectionManager connectionManager=new
PoolingClientConnectionManager(schemeRegistry, 15,
java.util.concurrent.TimeUnit.SECONDS);
                
                // Increase max total connection to 100
                connectionManager.setMaxTotal(100);
                // Increase default max connection per route to 15
                connectionManager.setDefaultMaxPerRoute(15);
                // Increase max connections for localhost:80 to 80
                HttpHost localhost = new HttpHost("locahost", 80);
                connectionManager.setMaxPerRoute(new HttpRoute(localhost), 50);

2012/6/14 Joan Balaguero <[email protected]>:
> Hello,
>
>
>
> I’ve been moving from 4.0.3 to 4.2.
>
>
>
> The following methods are deprecated:
>
>
>
>  ClientConnectionManager cm = new
> ThreadSafeClientConnManager(this.objHttpParams,
> HttpUtils.createDefaultSchemeRegistry());
>
>
>
>  ConnManagerParams.setTimeout(this.objHttpParams, 1);
>
>
>
>
> ConnManagerParams.setMaxTotalConnections(this.objHttpParams,Integer.MAX_VALU
> E);
>
>
>
>  ConnManagerParams.setMaxConnectionsPerRoute(this.objHttpParams, new
> ConnPerRouteBean(Integer.MAX_VALUE));
>
>
>
>
>
>
>
> I see that now I have to use:
>
>
>
>   ClientConnectionManager cm = new
> PoolingClientConnectionManager(HttpUtils.createDefaultSchemeRegistry());
>
>   this.objHttp               = new DefaultHttpClient(cm,
> this.objHttpParams);
>
>
>
>
>
> But how can I set the pool timeout, maxtotal and maxtotalperorute?
>
>
>
> Thanks,
>
> Joan.
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to