Java Code Examples for com.alibaba.dubbo.common.utils.NetUtils#filterLocalHost()

The following examples show how to use com.alibaba.dubbo.common.utils.NetUtils#filterLocalHost() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RpcContext.java    From dubbo-2.6.5 with Apache License 2.0 5 votes vote down vote up
/**
 * get local host.
 *
 * @return local host
 */
public String getLocalHost() {
    String host = localAddress == null ? null :
            localAddress.getAddress() == null ? localAddress.getHostName()
                    : NetUtils.filterLocalHost(localAddress.getAddress().getHostAddress());
    if (host == null || host.length() == 0) {
        return NetUtils.getLocalHost();
    }
    return host;
}
 
Example 2
Source File: RpcContext.java    From dubbox with Apache License 2.0 5 votes vote down vote up
/**
 * get local host.
 * 
 * @return local host
 */
public String getLocalHost() {
    String host = localAddress == null ? null : 
        localAddress.getAddress() == null ? localAddress.getHostName() 
                : NetUtils.filterLocalHost(localAddress.getAddress().getHostAddress());
    if (host == null || host.length() == 0) {
        return NetUtils.getLocalHost();
    }
    return host;
}
 
Example 3
Source File: RpcContext.java    From dubbox with Apache License 2.0 5 votes vote down vote up
/**
 * get local host.
 * 
 * @return local host
 */
public String getLocalHost() {
    String host = localAddress == null ? null : 
        localAddress.getAddress() == null ? localAddress.getHostName() 
                : NetUtils.filterLocalHost(localAddress.getAddress().getHostAddress());
    if (host == null || host.length() == 0) {
        return NetUtils.getLocalHost();
    }
    return host;
}
 
Example 4
Source File: RpcContext.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
/**
 * get local host.
 * 
 * @return local host
 */
public String getLocalHost() {
    String host = localAddress == null ? null : 
        localAddress.getAddress() == null ? localAddress.getHostName() 
                : NetUtils.filterLocalHost(localAddress.getAddress().getHostAddress());
    if (host == null || host.length() == 0) {
        return NetUtils.getLocalHost();
    }
    return host;
}
 
Example 5
Source File: RpcContext.java    From dubbox with Apache License 2.0 5 votes vote down vote up
/**
 * get local host.
 * 
 * @return local host
 */
public String getLocalHost() {
    String host = localAddress == null ? null : 
        localAddress.getAddress() == null ? localAddress.getHostName() 
                : NetUtils.filterLocalHost(localAddress.getAddress().getHostAddress());
    if (host == null || host.length() == 0) {
        return NetUtils.getLocalHost();
    }
    return host;
}
 
Example 6
Source File: RpcContext.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
/**
 * get local host.
 *
 * @return local host
 */
public String getLocalHost() {
    String host = localAddress == null ? null :
            localAddress.getAddress() == null ? localAddress.getHostName()
                    : NetUtils.filterLocalHost(localAddress.getAddress().getHostAddress());
    if (host == null || host.length() == 0) {
        return NetUtils.getLocalHost();
    }
    return host;
}
 
Example 7
Source File: RpcContext.java    From dubbox with Apache License 2.0 4 votes vote down vote up
/**
 * get remote host.
 * 
 * @return remote host
 */
public String getRemoteHost() {
    return remoteAddress == null ? null : 
        remoteAddress.getAddress() == null ? remoteAddress.getHostName() 
                : NetUtils.filterLocalHost(remoteAddress.getAddress().getHostAddress());
}
 
Example 8
Source File: AbstractClient.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
public InetSocketAddress getConnectAddress() {
    return new InetSocketAddress(NetUtils.filterLocalHost(getUrl().getHost()), getUrl().getPort());
}
 
Example 9
Source File: AbstractClient.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public InetSocketAddress getConnectAddress() {
    return new InetSocketAddress(NetUtils.filterLocalHost(getUrl().getHost()), getUrl().getPort());
}
 
Example 10
Source File: RpcContext.java    From dubbox with Apache License 2.0 4 votes vote down vote up
/**
 * get remote host.
 * 
 * @return remote host
 */
public String getRemoteHost() {
    return remoteAddress == null ? null : 
        remoteAddress.getAddress() == null ? remoteAddress.getHostName() 
                : NetUtils.filterLocalHost(remoteAddress.getAddress().getHostAddress());
}
 
Example 11
Source File: AbstractClient.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public InetSocketAddress getConnectAddress() {
    return new InetSocketAddress(NetUtils.filterLocalHost(getUrl().getHost()), getUrl().getPort());
}
 
Example 12
Source File: RpcContext.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
/**
 * get remote host.
 *
 * @return remote host
 */
public String getRemoteHost() {
    return remoteAddress == null ? null :
            remoteAddress.getAddress() == null ? remoteAddress.getHostName()
                    : NetUtils.filterLocalHost(remoteAddress.getAddress().getHostAddress());
}
 
Example 13
Source File: AbstractClient.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public InetSocketAddress getConnectAddress() {
    return new InetSocketAddress(NetUtils.filterLocalHost(getUrl().getHost()), getUrl().getPort());
}
 
Example 14
Source File: RpcContext.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
/**
 * get remote host.
 * 
 * @return remote host
 */
public String getRemoteHost() {
    return remoteAddress == null ? null : 
        remoteAddress.getAddress() == null ? remoteAddress.getHostName() 
                : NetUtils.filterLocalHost(remoteAddress.getAddress().getHostAddress());
}
 
Example 15
Source File: AbstractClient.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public InetSocketAddress getConnectAddress() {
    return new InetSocketAddress(NetUtils.filterLocalHost(getUrl().getHost()), getUrl().getPort());
}
 
Example 16
Source File: RpcContext.java    From dubbox with Apache License 2.0 4 votes vote down vote up
/**
 * get remote host.
 * 
 * @return remote host
 */
public String getRemoteHost() {
    return remoteAddress == null ? null : 
        remoteAddress.getAddress() == null ? remoteAddress.getHostName() 
                : NetUtils.filterLocalHost(remoteAddress.getAddress().getHostAddress());
}
 
Example 17
Source File: AbstractClient.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public InetSocketAddress getConnectAddress() {
    return new InetSocketAddress(NetUtils.filterLocalHost(getUrl().getHost()), getUrl().getPort());
}
 
Example 18
Source File: RpcContext.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
/**
 * get remote host.
 *
 * @return remote host
 */
public String getRemoteHost() {
    return remoteAddress == null ? null :
            remoteAddress.getAddress() == null ? remoteAddress.getHostName()
                    : NetUtils.filterLocalHost(remoteAddress.getAddress().getHostAddress());
}