From cbd93fb166c857c96f19bff9ff55d7404ee9dce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Tue, 20 May 2025 20:41:21 +0200 Subject: [PATCH] fixes client initialisation --- src/pydase/client/client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pydase/client/client.py b/src/pydase/client/client.py index 999ea0a..bdec294 100644 --- a/src/pydase/client/client.py +++ b/src/pydase/client/client.py @@ -134,8 +134,13 @@ class Client: def connect(self, block_until_connected: bool = True) -> None: if self._thread is None or self._loop is None: - self._initialize_socketio_client() self._loop = self._initialize_loop_and_thread() + self._initialize_socketio_client() + self.proxy = ProxyClass( + sio_client=self._sio, + loop=self._loop, + reconnect=self.connect, + ) connection_future = asyncio.run_coroutine_threadsafe( self._connect(), self._loop @@ -163,11 +168,6 @@ class Client: """ loop = asyncio.new_event_loop() - self.proxy = ProxyClass( - sio_client=self._sio, - loop=loop, - reconnect=self.connect, - ) self._thread = threading.Thread( target=asyncio_loop_thread, args=(loop,),