- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是 python 新手,我正在尝试测试 gevent-socketio 示例,但没有成功。每次访问 html 文件时都会出现此错误。在这种情况下,我发布了 live_cpu_graph
报告的错误,但 chat
也有同样的问题。
感谢您的帮助
Listening on port http://0.0.0.0:8080 and on port 10843 (flash policy server)
DEPRECATION WARNING: use `namespace` instead of `resource`
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/gevent/server.py", line 159, in wrap_socket_and_handle
ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
TypeError: wrap_socket() got an unexpected keyword argument 'policy_listener'
<Greenlet at 0x1cceb90: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x1dc0710 fileno=3 address=0.0.0.0:8080>>(<socket at 0x1dc08d0 fileno=10 sock=127.0.0.1:8080, ('127.0.0.1', 45823))> failed with TypeError
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/gevent/server.py", line 159, in wrap_socket_and_handle
ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
TypeError: wrap_socket() got an unexpected keyword argument 'policy_listener'
<Greenlet at 0x1cceb90: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x1dc0710 fileno=3 address=0.0.0.0:8080>>(<socket at 0x1dc08d0 fileno=10 sock=127.0.0.1:8080, ('127.0.0.1', 45824))> failed with TypeError
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/gevent/server.py", line 159, in wrap_socket_and_handle
ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
TypeError: wrap_socket() got an unexpected keyword argument 'policy_listener'
<Greenlet at 0x1cceb90: <bound method SocketIOServer.wrap_socket_and_handle of <SocketIOServer at 0x1dc0710 fileno=3 address=0.0.0.0:8080>>(<socket at 0x1dc08d0 fileno=10 sock=127.0.0.1:8080, ('127.0.0.1', 45826))> failed with TypeError
最佳答案
我想我已经决定改变这个:
if __name__ == '__main__':
print 'Listening on port http://0.0.0.0:8080 and on port 10843 (flash policy server)'
SocketIOServer(('0.0.0.0', 8080), Application(),
resource="socket.io", policy_server=True,
policy_listener=('0.0.0.0', 10843)).serve_forever(
这样:
if __name__ == '__main__':
print 'Listening on port http://0.0.0.0:8080'
SocketIOServer(('0.0.0.0', 8080), Application(),
resource="socket.io").serve_forever(
但是我真的不知道为什么。我希望有人能解释一下这一点。谢谢。
关于python - 类型错误 : wrap_socket() got an unexpected keyword argument 'policy_listener' | gevent-socketio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20211702/
我的图书馆是否有任何“官方”方式可以测试 gevent monkey 补丁是否已激活? 最佳答案 我不知道官方方法,但这是一种方法。 注意 os.fork 在猴子修补时发生变化: >>> import
存储在 threading.local 中的数据对于特定的协同例程来说是唯一的,还是对于 Python 线程来说仍然是唯一的? 最佳答案 根据 gevent.monkey 的文档 http://www
经过一整天的黑客攻击并试图找出问题所在后,我问了这个问题。 我想使用 requests 包发送请求,并以非阻塞模式进行。 为此,我使用了很好的 gevent 包及其猴子修补功能,我已经使用它很长时间了
我正在把我的头发拉到这个上面。我正在尝试使用 zeromq 和 gevent 获取最简单的示例。我将此脚本更改为使用 PUB/SUB 套接字,当我运行它时,“服务器”套接字将永远循环。如果我取消注释
我正在使用 Flask 和 Flask-SocketIO 构建 Web 接口(interface)/数据 API 以进行 websocket 通信。我想开始转向使用 Gevent/Gevent-web
假设 tasks 是 Greenlet 对象的列表。现在有什么区别 gevent.wait(tasks) 和 gevent.joinall(tasks) ? 最佳答案 不多! joinall 实际上在
我有一个使用线程的 python bottle 应用程序。因为我正在使用 monkey.patch ,线程正在阻止应用程序执行(从线程触发的对话框阻止瓶路由响应客户端,直到被关闭。) 这里的一项小研究
在 gevent monkey 补丁中,我没有看到任何关于默认文件对象的操作。如何在基于 gevent 的程序中使用异步文件读/写? 最佳答案 您可以使用 1.0b3 中可用的 gevent 的 fi
过去几天,我一直在尝试将事件流集成到我的 Flask 应用程序中,在我的本地测试中取得了不错的结果,但在我的服务器上使用 uWSGI 运行该应用程序时却有些糟糕。我的代码基本上建立在 example
来自 gevent 文档: The greenlets all run in the same OS thread and are scheduled cooperatively. 那么是否仍然需要使
我在 Gevent 池中执行几十个 HTTP 请求。 目标是在请求失败时重试一次,但仅重试一次。否则,它应该抛出异常。 我如何使用 at pool 编写 gevent 代码以支持在失败时重新运行一次
简而言之,我的问题是:我怎么知道某个特定的 Python 包何时与 gevent 兼容(至少与 gevent.monkey.patch_all 兼容)? 其实我想知道是否http-parser库与 g
为什么 gevent 会抛出这个错误?在 ipython、ubuntu 13 中运行它 In [1]: from gevent import monkey In [2]: monkey.patch_a
在我基于 gevent 的程序中,我在某处有一个线程,它陷入了一个循环,类似于: while True: gevent.sleep(0) 我怎么知道这是哪个线程?是否可以列出(并获取堆栈跟踪)
运行 gevent 的 WSGIServer 时,我遇到了一些非常奇怪的行为。似乎每个通过的请求的方法都被错误地解释了.. 如果我发送以下请求: requests.get('http://localh
我的项目正在使用 gevnet(这对我来说是新的)来实现 Thrift 服务器。 我正在阅读代码并从其文档中学习。下面的代码片段在我的项目中: TSocket.socket = gevent.sock
我尝试在我的 osX (el capitan) 上安装 Odoo。然后我下载了这个包,当我尝试使用 pip install -r requirements.txt 安装 3rf party lib 时
我有多个 greenlets 在一个公共(public)套接字上发送。是否保证通过 socket.sendall 发送的每个包都很好地分开,或者我是否必须在每次调用 sendall 之前获取锁。 所以
我刚开始使用 virtualenv,但我正在尝试安装 gevent在 virtualenv 环境中(我正在运行 Windows)。当我在 virtualenv 中使用 PIP 时,出现此错误: MyE
目前我正在使用带有发布-订阅模式的 zeromq,我有一个工作人员要发布和许多 (8) 个订阅者(都将订阅)相同的模式。 现在我尝试使用多处理来生成订阅者,它可以正常工作。我缺少一些消息。 我使用多处
我是一名优秀的程序员,十分优秀!