EchoTCPServerTraceCall.py 文件源码

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

项目:AoikTwistedStudy 作者: AoiKuiyuyou 项目源码 文件源码
def main():
    try:
        # Create end point
        endpoint = TCP4ServerEndpoint(
            reactor=reactor,
            port=8000,
            interface='127.0.0.1',
        )

        # Start listening
        endpoint.listen(Factory.forProtocol(EchoProtocol))

        # Run reactor
        reactor.run()

    # If have `KeyboardInterrupt`
    except KeyboardInterrupt:
        # Stop gracefully
        pass


# Trace calls in this module.
#
# Calling this function is needed because at the point `trace_calls_in_specs`
# is called, this module is being initialized, therefore callables defined
# after the call point are not accessible to `trace_calls_in_specs`.
#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号