Code example for ConnPerRouteBean

0
 
 
 
		HttpParams params = new BasicHttpParams();
		params.setParameter(ConnManagerPNames.MAX_TOTAL_CONNECTIONS, 30);
		params.setParameter(ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE, new ConnPerRouteBean(30));
		params.setParameter(HttpProtocolParams.USE_EXPECT_CONTINUE, false);
		HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
 
		//ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry); 
	         
	    SchemeRegistry registry = new SchemeRegistry();
	    registry.register(new Scheme("http", new PlainSocketFactory(), 80)); 
	    registry.register(new Scheme("https", (trustAll  ? EasySSLSocketFactory.getSocketFactory(): SSLSocketFactory.getSocketFactory()), 443));
	    DefaultHttpClient client = new DefaultHttpClient(new ThreadSafeClientConnManager(params, registry), params);
		 
	       return client;
	} 
	 
	public CaldavFacade(String mUser, String mPassword, String mURL) throws MalformedURLException  {
Experience pair programming with AI  Get Codota for Java