Example usage for org.apache.http.nio.conn.scheme AsyncScheme resolvePort

List of usage examples for org.apache.http.nio.conn.scheme AsyncScheme resolvePort

Introduction

In this page you can find the example usage for org.apache.http.nio.conn.scheme AsyncScheme resolvePort.

Prototype

public final int resolvePort(final int port) 

Source Link

Usage

From source file:org.apache.http.impl.nio.conn.HttpNIOConnPool.java

@Override
protected SocketAddress resolveRemoteAddress(final HttpRoute route) {
    HttpHost firsthop = route.getProxyHost();
    if (firsthop == null) {
        firsthop = route.getTargetHost();
    }/*from   w  w  w .  j  a va  2s  .  c o m*/
    final String hostname = firsthop.getHostName();
    int port = firsthop.getPort();
    if (port < 0) {
        final AsyncScheme scheme = this.schemeRegistry.getScheme(firsthop);
        port = scheme.resolvePort(port);
    }
    return new InetSocketAddress(hostname, port);
}