Code example for ConnPerRouteBean

0
		schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
		schemeRegistry.register(new Scheme("https", new ISMINSSLSocketFactory(), 443));
		 
		params = new BasicHttpParams();
        params.setParameter(ConnManagerPNames.MAX_TOTAL_CONNECTIONS, 1);
        params.setParameter(ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE, new ConnPerRouteBean(1));		
        params.setParameter(HttpProtocolParams.USE_EXPECT_CONTINUE, false);		
        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);		
        HttpProtocolParams.setContentCharset(params, "utf8");		
         
        clientConnectionManager = new ThreadSafeClientConnManager(params, schemeRegistry);
         
        httpClient = new DefaultHttpClient(clientConnectionManager, params);
 
        /* 
         * Those one define my post method. The server and the form parameters 
         */ 
        httpPost = new HttpPost("https://securelogin.arubanetworks.com/cgi-bin/login");
        List <NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
        nameValuePairs.add(new BasicNameValuePair("user",username));
        nameValuePairs.add(new BasicNameValuePair("password",password));