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;
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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,
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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,
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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;
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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);            
        } 
         
        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;
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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);            
        } 
         
        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;
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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);            
        } 
         
        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;
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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);            
        } 
         
        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;
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
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);            
        } 
         
        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;
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Android HostNameResolver Methods: