java类org.apache.http.util.NetUtils的实例源码

BHttpConnectionBase.java 文件源码 项目:remote-files-sync 阅读 21 收藏 0 点赞 0 评论 0
@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]";
    }
}
BHttpConnectionBase.java 文件源码 项目:Visit 阅读 21 收藏 0 点赞 0 评论 0
@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]";
    }
}
BHttpConnectionBase.java 文件源码 项目:ZTLib 阅读 21 收藏 0 点赞 0 评论 0
@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]";
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号