哪里说插座.recv()如果流的另一端调用了插座关闭()?

2024-04-19 04:02:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在浏览the Python documentation,但似乎找不到像上面这样的具体细节。这些细节列在哪里?你知道吗


Tags: thedocumentation细节
1条回答
网友
1楼 · 发布于 2024-04-19 04:02:44

既然你想要文件,下面是最接近的东西,我可以得到的文件。你知道吗

Python documentation --

The Python interface is a straightforward transliteration of the Unix system call and library interface for sockets

Unix documentation for recv开始,在返回值部分下-

When a stream socket peer has performed an orderly shutdown, the return value will be 0 (the traditional "end-of-file" return).

当您将0转换为bytes对象时,您将得到一个空bytes对象。示例-

>>> bytes(0)
b''

相关问题 更多 >