Java 类org.apache.http.util.NetUtils 实例源码

项目:remote-files-sync    文件:BHttpConnectionBase.java   
@Override
public String toString() {
    if (this.socket != null) {
        final StringBuilder buffer = new StringBuilder();
        final SocketAddress remoteAddress = this.socket.getRemoteSocketAddress();
        final SocketAddress localAddress = this.socket.getLocalSocketAddress();
        if (remoteAddress != null && localAddress != null) {
            NetUtils.formatAddress(buffer, localAddress);
            buffer.append("<->");
            NetUtils.formatAddress(buffer, remoteAddress);
        }
        return buffer.toString();
    } else {
        return "[Not bound]";
    }
}
项目:Visit    文件:BHttpConnectionBase.java   
@Override
public String toString() {
    if (this.socket != null) {
        final StringBuilder buffer = new StringBuilder();
        final SocketAddress remoteAddress = this.socket.getRemoteSocketAddress();
        final SocketAddress localAddress = this.socket.getLocalSocketAddress();
        if (remoteAddress != null && localAddress != null) {
            NetUtils.formatAddress(buffer, localAddress);
            buffer.append("<->");
            NetUtils.formatAddress(buffer, remoteAddress);
        }
        return buffer.toString();
    } else {
        return "[Not bound]";
    }
}
项目:ZTLib    文件:BHttpConnectionBase.java   
@Override
public String toString() {
    if (this.socket != null) {
        final StringBuilder buffer = new StringBuilder();
        final SocketAddress remoteAddress = this.socket.getRemoteSocketAddress();
        final SocketAddress localAddress = this.socket.getLocalSocketAddress();
        if (remoteAddress != null && localAddress != null) {
            NetUtils.formatAddress(buffer, localAddress);
            buffer.append("<->");
            NetUtils.formatAddress(buffer, remoteAddress);
        }
        return buffer.toString();
    } else {
        return "[Not bound]";
    }
}