Miguel Grinberg
4 months ago
Failed to extract signature
2 changed files with
9 additions and
5 deletions
-
src/socketio/async_client.py
-
src/socketio/client.py
|
|
@ -188,9 +188,10 @@ class AsyncClient(base_client.BaseClient): |
|
|
|
while True: |
|
|
|
await self.eio.wait() |
|
|
|
await self.sleep(1) # give the reconnect task time to start up |
|
|
|
if self.eio.state == 'connected': # connected during await self.sleep(1) |
|
|
|
continue |
|
|
|
if not self._reconnect_task: |
|
|
|
if self.eio.state == 'connected': # pragma: no cover |
|
|
|
# connected while sleeping above |
|
|
|
continue |
|
|
|
break |
|
|
|
await self._reconnect_task |
|
|
|
if self.eio.state != 'connected': |
|
|
|
|
|
@ -179,9 +179,12 @@ class Client(base_client.BaseClient): |
|
|
|
while True: |
|
|
|
self.eio.wait() |
|
|
|
self.sleep(1) # give the reconnect task time to start up |
|
|
|
if self.eio.state != 'connected': # reconnect task finished while `self.sleep(1)` was executing |
|
|
|
continue |
|
|
|
if not self._reconnect_task: |
|
|
|
if self.eio.state == 'connected': # pragma: no cover |
|
|
|
# connected while sleeping above |
|
|
|
continue |
|
|
|
else: |
|
|
|
# the reconnect task gave up |
|
|
|
break |
|
|
|
self._reconnect_task.join() |
|
|
|
if self.eio.state != 'connected': |
|
|
|