Android HostNameResolver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android HostNameResolver class.

This code example shows how to use the following methods: resolve
        int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
        int soTimeout = HttpConnectionParams.getSoTimeout(params);
 
        InetSocketAddress remoteAddress;
        if (nameResolver != null) {
            remoteAddress = new InetSocketAddress(nameResolver.resolve(host), port);
        } else { 
            remoteAddress = new InetSocketAddress(host, port);
        } 
 
        sslsock.connect(remoteAddress, connTimeout);
 
        sslsock.setSoTimeout(soTimeout);
        try { 
            hostnameVerifier.verify(host, sslsock);
            // verifyHostName() didn't blowup - good! 
        } catch (IOException iox) {
            // close the socket before re-throwing the exception 
            try { sslsock.close(); } catch (Exception x) { /*ignore*/ }
            throw iox;
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: resolve
local = new InetSocketAddress(localAddress, localPort);
        } 
        InetAddress remoteAddress;
        if (this.nameResolver != null) {
            remoteAddress = this.nameResolver.resolve(host);
        } else { 
            remoteAddress = InetAddress.getByName(host);
        } 
        InetSocketAddress remote = new InetSocketAddress(remoteAddress, port);
        return connectSocket(socket, remote, local, params);
    } 
 
    /** 
     * @deprecated Use {@link #createLayeredSocket(Socket, String, int, boolean)} 
     */ 
    @Deprecated 
    public Socket createSocket(
            final Socket socket,
            final String host, int port,
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: resolve
local = new InetSocketAddress(localAddress, localPort);
        } 
        InetAddress remoteAddress;
        if (this.nameResolver != null) {
            remoteAddress = this.nameResolver.resolve(host);
        } else { 
            remoteAddress = InetAddress.getByName(host);
        } 
        InetSocketAddress remote = new InetSocketAddress(remoteAddress, port);
        return connectSocket(socket, remote, local, params);
    } 
 
    /** 
     * @deprecated Use {@link #createLayeredSocket(Socket, String, int, boolean)} 
     */ 
    @Deprecated 
    public Socket createSocket(
            final Socket socket,
            final String host, int port,
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: resolve
        int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
        int soTimeout = HttpConnectionParams.getSoTimeout(params);
 
        InetSocketAddress remoteAddress;
        if (this.nameResolver != null) {
            remoteAddress = new InetSocketAddress(this.nameResolver.resolve(host), port); 
        } else { 
            remoteAddress = new InetSocketAddress(host, port);            
        } 
        try { 
            sslsock.connect(remoteAddress, connTimeout);
        } catch (SocketTimeoutException ex) {
            throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out");
        } 
        sslsock.setSoTimeout(soTimeout);
        try { 
            hostnameVerifier.verify(host, sslsock);
            // verifyHostName() didn't blowup - good! 
        } catch (IOException iox) {
            // close the socket before re-throwing the exception 
Full Snippet Info
3
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: resolve
        int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
        int soTimeout = HttpConnectionParams.getSoTimeout(params);
 
        InetSocketAddress remoteAddress;
        if (nameResolver != null) {
            remoteAddress = new InetSocketAddress(nameResolver.resolve(host), port);
        } else { 
            remoteAddress = new InetSocketAddress(host, port);
        } 
 
        sslsock.connect(remoteAddress, connTimeout);
 
        sslsock.setSoTimeout(soTimeout);
        try { 
            hostnameVerifier.verify(host, sslsock);
            // verifyHostName() didn't blowup - good! 
        } catch (IOException iox) {
            // close the socket before re-throwing the exception 
            try { sslsock.close(); } catch (Exception x) { /*ignore*/ }
            throw iox;
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Android HostNameResolver Methods: