我正在阅读一些代码并且遇到了这一行
socket.error errno.EWOULDBLOCK
谁能告诉我引发此错误的条件是什么?
请您参考如下方法:
来自 Python 的套接字模块:http://docs.python.org/library/socket.html
Initially all sockets are in blocking mode. In non-blocking mode, if a recv() call doesn’t find any data, or if a send() call can’t immediately dispose of the data, a error exception is raised.
它所指的错误异常是 errno.EWOULDBLOCK
为此,必须使用以下方法将套接字对象设置为非阻塞模式:socketObj.setblocking(0)
