example_tcpt.py 文件源码

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

项目:ooniprobe-debian 作者: TheTorProject 项目源码 文件源码
def test_hello_world(self):
        def got_response(response):
            print "Got this data %s" % response

        def connection_failed(failure):
            failure.trap(ConnectionRefusedError)
            print "Connection Refused"

        self.address = "127.0.0.1"
        self.port = 57002
        payload = "Hello World!\n\r"
        d = self.sendPayload(payload)
        d.addErrback(connection_failed)
        d.addCallback(got_response)
        return d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号