Search in sources :

Example 1 with ConnPerRouteBean

use of cz.msebera.android.httpclient.conn.params.ConnPerRouteBean in project android-async-http by loopj.

the class AsyncHttpClient method setMaxConnections.

/**
     * Sets maximum limit of parallel connections
     *
     * @param maxConnections maximum parallel connections, must be at least 1
     */
public void setMaxConnections(int maxConnections) {
    if (maxConnections < 1)
        maxConnections = DEFAULT_MAX_CONNECTIONS;
    this.maxConnections = maxConnections;
    final HttpParams httpParams = this.httpClient.getParams();
    ConnManagerParams.setMaxConnectionsPerRoute(httpParams, new ConnPerRouteBean(this.maxConnections));
}
Also used : HttpParams(cz.msebera.android.httpclient.params.HttpParams) BasicHttpParams(cz.msebera.android.httpclient.params.BasicHttpParams) ConnPerRouteBean(cz.msebera.android.httpclient.conn.params.ConnPerRouteBean)

Aggregations

ConnPerRouteBean (cz.msebera.android.httpclient.conn.params.ConnPerRouteBean)1 BasicHttpParams (cz.msebera.android.httpclient.params.BasicHttpParams)1 HttpParams (cz.msebera.android.httpclient.params.HttpParams)1