我正在 python 3.6.1 中开发一个简单的聊天应用程序供个人使用。我在 select.select 时遇到此错误:
Traceback (most recent call last):
File "C:\Users\Nathan Glover\Google Drive\MAGENTA Chat\chat_server.py", line
27, in <module>
ready_to_read,ready_to_write,in_error = select.select(SOCKET_LIST,[],[],0)
ValueError: file descriptor cannot be a negative integer (-1)
Run Code Online (Sandbox Code Playgroud)
这是代码:
ready_to_read,ready_to_write,in_error = select.select(SOCKET_LIST,[],[],0)
Run Code Online (Sandbox Code Playgroud)
这完全是因为我不太了解 select ,并且文档没有帮助。有人可以解释为什么会发生这种情况吗?