Package org.apache.http.conn.params

Examples of org.apache.http.conn.params.ConnPerRoute


    public HttpClient createHttpClient() {
        HttpParams defaultParameters = new BasicHttpParams();
        //defaultParameters.setIntParameter(HttpConnectionManagerParams.MAX_TOTAL_CONNECTIONS, 10);

        ConnManagerParams.setMaxTotalConnections(defaultParameters, 1024);
        ConnPerRoute connPerRoute = new ConnPerRouteBean(256);
        ConnManagerParams.setMaxConnectionsPerRoute(defaultParameters, connPerRoute);

        HttpProtocolParams.setContentCharset(defaultParameters, HTTP.UTF_8);
        HttpConnectionParams.setConnectionTimeout(defaultParameters, 60000);
        HttpConnectionParams.setSoTimeout(defaultParameters, 60000);
View Full Code Here


      if (utils.getMaxConnections() > 0)
         ConnManagerParams.setMaxTotalConnections(params, utils.getMaxConnections());

      if (utils.getMaxConnectionsPerHost() > 0) {
         ConnPerRoute connectionsPerRoute = new ConnPerRouteBean(utils.getMaxConnectionsPerHost());
         ConnManagerParams.setMaxConnectionsPerRoute(params, connectionsPerRoute);
      }
      HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
      return params;
   }
View Full Code Here

TOP

Related Classes of org.apache.http.conn.params.ConnPerRoute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.