我正在尝试使用龙卷风编写本地通信软件。以下代码在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
我对龙卷风根不熟悉。没有可用的解决方案。请帮忙。谢谢