Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 我使用self.transport.write函数写入tcp流,如何使用flush呢?_Python 2.7_Twisted - Fatal编程技术网

Python 2.7 我使用self.transport.write函数写入tcp流,如何使用flush呢?

Python 2.7 我使用self.transport.write函数写入tcp流,如何使用flush呢?,python-2.7,twisted,Python 2.7,Twisted,我用Twisted框架创建了一个简单的tcp连接服务器。我使用self.transport.write函数将数据写入客户端,但我需要刷新数据。有办法做到这一点吗?另外,有没有办法刷新传入数据?没有必要也没有办法刷新读缓冲区或写缓冲区。我想我看到了一个使用stdout->stdout.flush()的方法。扭曲的框架不是这样吗?这就是“无法刷新”的意思,是的。幸运的是,正如我提到的,也没有必要。

我用Twisted框架创建了一个简单的tcp连接服务器。我使用
self.transport.write
函数将数据写入客户端,但我需要刷新数据。有办法做到这一点吗?另外,有没有办法刷新传入数据?

没有必要也没有办法刷新读缓冲区或写缓冲区。

我想我看到了一个使用stdout->stdout.flush()的方法。扭曲的框架不是这样吗?这就是“无法刷新”的意思,是的。幸运的是,正如我提到的,也没有必要。