1

我正在twisted用 Python 开发一个聊天应用程序。我正在使用transport.write()写入 TCP 流。

但是,有时,我注意到在客户端接收到的数据是组合的(连接的)。

有什么办法可以清除缓冲区或刷新数据,以便在发送数据时接收数据而不是缓冲?

谢谢

4

1 回答 1

2

这与此常见问题解答项目基本相同:

http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#Whyisprotocol.dataReceivedcalledwithonlypartofthedataIcalledtransport.writewith

于 2013-06-20T19:14:16.163 回答