【发布时间】:2016-02-21 10:53:47
【问题描述】:
我有一个 LineReceiver 协议,想发送两个这样的响应:
def handle_CLIENT(self, data):
...
self.sendLine(r1.raw)
...
self.sendLine(r2.raw)
Twisted 将两个响应合并为一个,例如 Multiple responses in Twisted。客户是专有的,我无法改变它的行为。使它起作用的正确方法是什么?谢谢。
编辑
def handle_CLIENT(self, data):
...
self.sendLine(r1.raw)
reactor.doIteration(0.5)
...
self.sendLine(r2.raw)
这对我有用,但我想这不是正确的方法。因为我不知道何时会有多个客户:)
【问题讨论】: