tcp.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:Parlay 作者: PromenadeSoftware 项目源码 文件源码
def connect(self, adapter, ip, port):
        """ Establish a new TCP connection and link it with this protocol. """

        endpoint = TCP4ClientEndpoint(adapter.reactor, ip, port)
        d = connectProtocol(endpoint, self)

        def bad_connection(failure):
            message = "Could not connect to {}:{}\n {}\n".format(ip, port, failure.getErrorMessage())
            raise IOError(message)

        d.addErrback(bad_connection)
        return d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号