A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

©   /  2011-9-20 10:19  /  1552 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

黑马网友  发表于 2011-9-20 13:09:55
楼主
[code]public int getPort() {
        if (!isConnected())
            return 0;
        try {
            return getImpl().getPort();
        } catch (SocketException e) {
            // Shouldn't happen as we're connected
        }
        return -1;
    }   

SocketImpl getImpl() throws SocketException {
        if (!created)
            createImpl(true);
        return impl;
    }
    void setImpl() {
        if (factory != null) {
            impl = factory.createSocketImpl();
            checkOldImpl();
        } else {
            // No need to do a checkOldImpl() here, we know it's an up to date
            // SocketImpl!
            impl = new SocksSocketImpl();
        }
        if (impl != null)
            impl.setSocket(this);
    }[/code]自己看源码吧,帮你摘出来一些!!
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马