由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - python的aiohttp好烂啊
进入Programming版参与讨论
1 (共1页)
m*****n
发帖数: 3575
1
一堆的坑。
我弄了个主动去连接别人的aiohttp.ClientSession (websocket)
对方每秒都主动推心跳过来
这边
msg = await ws.receive(timeout=6)
还每半分钟就跳一个
File "/usr/local/python3.8/lib/python3.8/site-packages/aiohttp/client_ws.
py", line 229, in receive
msg = await self._reader.read()
File "/usr/local/python3.8/lib/python3.8/site-packages/aiohttp/streams.py"
, line 657, in read
return await super().read()
File "/usr/local/python3.8/lib/python3.8/site-packages/aiohttp/streams.py"
, line 616, in read
await self._waiter
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/monitor/fun.py", line 1028, in quotation
async for msg in myreceive(ws):
File "/root/monitor/fun.py", line 597, in myreceive
msg = await ws.receive(timeout=6)
File "/usr/local/python3.8/lib/python3.8/site-packages/aiohttp/client_ws.
py", line 229, in receive
msg = await self._reader.read()
File "/usr/local/python3.8/lib/python3.8/site-packages/async_timeout/__
init__.py", line 129, in __aexit__
self._do_exit(exc_type)
File "/usr/local/python3.8/lib/python3.8/site-packages/async_timeout/__
init__.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
1 (共1页)
进入Programming版参与讨论