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 |
|