龙卷风TCPClient没有属性'stream'

时间:2018-11-12 08:57:45

标签: python tornado

我正在尝试使用龙卷风编写本地通信软件。以下代码在Windows上可以正常运行,但是它告诉我在Linux中“ ChatClient没有属性'stream'”。

class ChatClient(object):
    def __init__(self, host, port):
        memory.c = self
        self.host = host
        self.port = port
        self.EOF = protocol.MessageType.EOF

    @gen.coroutine
    def start(self, timeout=0):
        try:
            self.stream = yield TCPClient().connect(self.host, self.port)
            message = message_handle.login_request()
            yield self.stream.write(message + self.EOF)
            yield self.receive_message()
            yield self.send_message()
        except Exception as e:
            log something

    @gen.coroutine
    def send_message(self, data=str(protocol.MessageType.invalid)):
        do something

    @gen.coroutine
    def receive_message(self):
        do something

我对龙卷风根不熟悉。没有可用的解决方案。请帮忙。谢谢

0 个答案:

没有答案