Example usage for org.apache.http.params HttpConnectionParams getConnectionTimeout

List of usage examples for org.apache.http.params HttpConnectionParams getConnectionTimeout

Introduction

In this page you can find the example usage for org.apache.http.params HttpConnectionParams getConnectionTimeout.

Prototype

public static int getConnectionTimeout(HttpParams httpParams) 

Source Link

Usage

From source file:org.apache.http.impl.nio.client.DefaultAsyncRequestDirector.java

private void requestConnection() {
    final HttpRoute route = this.mainRequest.getRoute();
    if (this.log.isDebugEnabled()) {
        this.log.debug("[exchange: " + this.id + "] Request connection for " + route);
    }//from  w w w.j a  va2s  .  c o  m
    final long connectTimeout = HttpConnectionParams.getConnectionTimeout(this.params);
    final Object userToken = this.localContext.getAttribute(ClientContext.USER_TOKEN);
    this.connRequestCallback = new InternalFutureCallback();
    this.connmgr.leaseConnection(route, userToken, connectTimeout, TimeUnit.MILLISECONDS,
            this.connRequestCallback);
}