AttributeError:'Socket'对象没有属性'recv'

时间:2013-05-08 14:38:50

标签: django socket.io gevent

我试图让这个例子(https://github.com/sontek/django-tictactoe/tree/master/small_tictactoe)运行gevent-socketio但是我得到了这个非常奇怪的错误:

Internal Server Error: /socket.io/1/websocket/49318546715
Traceback (most recent call last):
File "/Users/User/Envs/Echtzeit/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/Users/User/Envs/Echtzeit/small_tictactoe/apps/core/views.py", line 37, in socketio
message = socketio.recv()
AttributeError: 'Socket' object has no attribute 'recv'

但我发现socketio.recv()在其他例子中也用作文件......

1 个答案:

答案 0 :(得分:2)

这个例子是两岁。因为那个api已经改变了。你现在可以看到没有recv方法存在。您可以检查存在的方法here