Connection loss is never detected by receive_json()
.
Providing a timeout
parameter to ws.receive_json()
doesn't help any.
async with AsyncClient() as client:
async with aconnect_ws(self._uri, client, keepalive_ping_timeout_seconds=None) as ws:
while ws.connection.state is ConnectionState.OPEN:
await ws.receive_json()
When connection is lost, ws.receive*() raises an error and the async context manager calls __aexit__
.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too