Code example for HttpHost

Methods: getHostName, getPort, getSchemeName

0
        public SocketAddress resolveLocalAddress(final HttpHost host) {
            return null; 
        } 
 
        public SocketAddress resolveRemoteAddress(final HttpHost host) {
            final String hostname = host.getHostName();
            int port = host.getPort();
            if (port == -1) {
                if (host.getSchemeName().equalsIgnoreCase("http")) {
                    port = 80;
                } else if (host.getSchemeName().equalsIgnoreCase("https")) {
                    port = 443;
                } 
            } 
            return new InetSocketAddress(hostname, port);
        } 
 
    } 
 
    /** 
     * @deprecated (4.3) use {@link BasicNIOConnPool#BasicNIOConnPool(ConnectingIOReactor, NIOConnFactory, int)}