Examples of resolvePort()


Examples of org.apache.http.conn.scheme.Scheme.resolvePort()

        Scheme schm = schemeRegistry.getScheme(target.getSchemeName());
        SchemeSocketFactory sf = schm.getSchemeSocketFactory();

        InetAddress[] addresses = resolveHostname(target.getHostName());
        int port = schm.resolvePort(target.getPort());
        for (int i = 0; i < addresses.length; i++) {
            InetAddress address = addresses[i];
            boolean last = i == addresses.length - 1;

            Socket sock = sf.createSocket(params);
View Full Code Here

Examples of org.apache.http.conn.scheme.Scheme.resolvePort()

        if (target.getPort() < 0) {
            SchemeRegistry schemeRegistry = (SchemeRegistry) context.getAttribute(
                    ClientContext.SCHEME_REGISTRY);
            Scheme scheme = schemeRegistry.getScheme(target);
            target = new HttpHost(target.getHostName(),
                    scheme.resolvePort(target.getPort()), target.getSchemeName());
        }

        AuthState targetState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE);
        if (target != null && targetState != null && targetState.getState() == AuthProtocolState.UNCHALLENGED) {
            AuthScheme authScheme = authCache.get(target);
View Full Code Here

Examples of org.apache.http.conn.scheme.Scheme.resolvePort()

                if (target.getPort() < 0) {
                    SchemeRegistry schemeRegistry = (SchemeRegistry) context.getAttribute(
                            ClientContext.SCHEME_REGISTRY);
                    Scheme scheme = schemeRegistry.getScheme(target);
                    target = new HttpHost(target.getHostName(),
                            scheme.resolvePort(target.getPort()), target.getSchemeName());
                }
                if (authCache == null) {
                    authCache = new BasicAuthCache();
                    context.setAttribute(ClientContext.AUTH_CACHE, authCache);
                }
View Full Code Here

Examples of org.apache.http.conn.scheme.Scheme.resolvePort()

        Socket sock = sf.createSocket();
        conn.opening(sock, target);

        try {
            sock = sf.connectSocket(sock, target.getHostName(),
                    schm.resolvePort(target.getPort()),
                    local, 0, params);
        } catch (ConnectException ex) {
            throw new HttpHostConnectException(target, ex);
        }
        prepareSocket(sock, context, params);
View Full Code Here

Examples of org.apache.http.conn.scheme.Scheme.resolvePort()

            // Obtain the scheme registry
            SchemeRegistry sr = (SchemeRegistry) context.getAttribute(
                    ClientContext.SCHEME_REGISTRY);
            if (sr != null) {
                Scheme scheme = sr.get(targetHost.getSchemeName());
                port = scheme.resolvePort(port);
            } else {
                port = conn.getRemotePort();
            }
        }
       
View Full Code Here

Examples of org.apache.http.conn.scheme.Scheme.resolvePort()

    @Test
    public void testResolvePort() {
        Scheme http = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());

        Assert.assertEquals(8080, http.resolvePort(8080));
        Assert.assertEquals(80, http.resolvePort(-1));
    }

    @Test
    public void testHashCode() {
View Full Code Here

Examples of org.apache.http.conn.scheme.Scheme.resolvePort()

    @Test
    public void testResolvePort() {
        Scheme http = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());

        Assert.assertEquals(8080, http.resolvePort(8080));
        Assert.assertEquals(80, http.resolvePort(-1));
    }

    @Test
    public void testHashCode() {
        Scheme http = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
View Full Code Here

Examples of org.apache.http.nio.conn.scheme.AsyncScheme.resolvePort()

        }
        String hostname = firsthop.getHostName();
        int port = firsthop.getPort();
        if (port < 0) {
            AsyncScheme scheme = this.schemeRegistry.getScheme(firsthop);
            port = scheme.resolvePort(port);
        }
        return new InetSocketAddress(hostname, port);
    }

    @Override
View Full Code Here

Examples of org.apache.http.nio.conn.scheme.AsyncScheme.resolvePort()

        }
        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);
    }

    @Override
View Full Code Here

Examples of org.apache.http.nio.conn.scheme.AsyncScheme.resolvePort()

        }
        String hostname = firsthop.getHostName();
        int port = firsthop.getPort();
        if (port < 0) {
            AsyncScheme scheme = this.schemeRegistry.getScheme(firsthop);
            port = scheme.resolvePort(port);
        }
        return new InetSocketAddress(hostname, port);
    }

    @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.