Python,asyncore,asynchat,Python 2.7.3 Mac上的错误文件描述错误

2024-05-26 16:28:47 发布

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

当我试图强制断开用户与自定义Python服务器的连接时,出现了一个崩溃错误。 我使用的是asyncore和asynchat类。在

但当我想强行切断连接时

asynchat.async_chat.close (self)

我有个错误:

^{pr2}$

但只在Python Mac上。在Windows上没有问题。。。在

的代码源中有一个execption异步.py班级。但是服务器崩溃了。在

  try:
        r, w, e = select.select(r, w, e, timeout)
    except select.error, err:
        if err.args[0] != EINTR:
            raise
        else:
            return

太奇怪了。。。在


Tags: 代码用户self服务器closeasyncwindowsmac
1条回答
网友
1楼 · 发布于 2024-05-26 16:28:47

我刚在谷歌上找到一条线索:http://bytes.com/topic/python/answers/589612-asyncore-select-statement-problem

此问题仅在OS X上发生。在

修改/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py,并将use_poll的默认值从False设置为True

第207行:

def loop(timeout=30.0, use_poll=False, map=None, count=None):

^{pr2}$

相关问题 更多 >

    热门问题