gpt4 book ai didi

python - 使用 tac 文件与 twistd 一起运行时出现高速公路 websocket 问题

转载 作者:太空宇宙 更新时间:2023-11-03 11:25:51 25 4
gpt4 key购买 nike

我有一个使用 autobahn 实现的 WebSocket 服务器使用 twisted 的 WebSocket 框架。当程序使用 python 运行时,WebSocket 服务器运行良好。但是,如果我通过将 tac 文件创建为扭曲服务来使用 twistd server runner 运行此程序,当任何客户端尝试建立连接并且握手失败时,我会在服务器中收到以下错误。

2015-12-08 07:17:56,022 - CRITICAL - twisted.publishToNewObserver() 154 Unhandled Error
Traceback (most recent call last):
File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/python/log.py", line 84, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 597, in _doReadOrWrite
why = selectable.doRead()
--- <exception caught here> ---
File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 1067, in doRead
protocol = self.factory.buildProtocol(self._buildAddr(addr))
File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/twisted/internet/protocol.py", line 135, in buildProtocol
p = self.protocol()
File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 665, in __init__
self.is_closed = txaio.create_future()
File "/opt/nrgi-ws/nrgi-ws-virtual-env/local/lib/python2.7/site-packages/txaio/_unframework.py", line 43, in _throw_usage_error
"To use txaio, you must first select a framework "
exceptions.RuntimeError: To use txaio, you must first select a framework with .use_twisted() or .use_txaio()

最佳答案

我今天发现了同样的问题。你应该将 txaio 降级到 1.1.0 版本

这是我的点数列表高速公路 (0.10.9)高速公路测试套件 (0.7.3)扭曲 (15.4.0)txaio (1.1.0)zope.interface (4.1.3)

关于python - 使用 tac 文件与 twistd 一起运行时出现高速公路 websocket 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34157314/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com