diff --git a/src/socketio/async_client.py b/src/socketio/async_client.py index e79fce0..4869dfa 100644 --- a/src/socketio/async_client.py +++ b/src/socketio/async_client.py @@ -188,7 +188,7 @@ class AsyncClient(base_client.BaseClient): while True: await self.eio.wait() await self.sleep(1) # give the reconnect task time to start up - if not self._reconnect_task: + if not self._reconnect_task and self.eio.state != 'connected': break await self._reconnect_task if self.eio.state != 'connected':