diff --git a/src/socketio/async_client.py b/src/socketio/async_client.py index 463073e..c7f5e86 100644 --- a/src/socketio/async_client.py +++ b/src/socketio/async_client.py @@ -191,6 +191,7 @@ class AsyncClient(base_client.BaseClient): if not self._reconnect_task: if self.eio.state == 'connected': # pragma: no cover # connected while sleeping above + print('oops') continue break await self._reconnect_task @@ -324,7 +325,7 @@ class AsyncClient(base_client.BaseClient): for n in self.namespaces: await self._send_packet(self.packet_class(packet.DISCONNECT, namespace=n)) - await self.eio.disconnect(abort=True) + await self.eio.disconnect() async def shutdown(self): """Stop the client. diff --git a/src/socketio/client.py b/src/socketio/client.py index ade2dd6..746d2c4 100644 --- a/src/socketio/client.py +++ b/src/socketio/client.py @@ -306,7 +306,7 @@ class Client(base_client.BaseClient): for n in self.namespaces: self._send_packet(self.packet_class( packet.DISCONNECT, namespace=n)) - self.eio.disconnect(abort=True) + self.eio.disconnect() def shutdown(self): """Stop the client. diff --git a/tests/async/test_client.py b/tests/async/test_client.py index 3eec1a8..d7e0f9e 100644 --- a/tests/async/test_client.py +++ b/tests/async/test_client.py @@ -475,7 +475,7 @@ class TestAsyncClient: c._send_packet.await_args_list[0][0][0].encode() == expected_packet.encode() ) - c.eio.disconnect.assert_awaited_once_with(abort=True) + c.eio.disconnect.assert_awaited_once_with() async def test_disconnect_namespaces(self): c = async_client.AsyncClient() @@ -993,7 +993,7 @@ class TestAsyncClient: c._send_packet.await_args_list[0][0][0].encode() == expected_packet.encode() ) - c.eio.disconnect.assert_awaited_once_with(abort=True) + c.eio.disconnect.assert_awaited_once_with() async def test_shutdown_disconnect_namespaces(self): c = async_client.AsyncClient() diff --git a/tests/common/test_client.py b/tests/common/test_client.py index ac930c7..7ee2bac 100644 --- a/tests/common/test_client.py +++ b/tests/common/test_client.py @@ -633,7 +633,7 @@ class TestClient: c._send_packet.call_args_list[0][0][0].encode() == expected_packet.encode() ) - c.eio.disconnect.assert_called_once_with(abort=True) + c.eio.disconnect.assert_called_once_with() def test_disconnect_namespaces(self): c = client.Client() @@ -1138,7 +1138,7 @@ class TestClient: c._send_packet.call_args_list[0][0][0].encode() == expected_packet.encode() ) - c.eio.disconnect.assert_called_once_with(abort=True) + c.eio.disconnect.assert_called_once_with() def test_shutdown_disconnect_namespaces(self): c = client.Client()