From 2c7ecc02e9fc857392bf180f3f7c50c87bd7d9cb Mon Sep 17 00:00:00 2001 From: Michael Woods Date: Sat, 15 Feb 2025 15:49:19 -0500 Subject: [PATCH] Adding connection wait for connected status to new_connection. --- src/packetserver/client/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/packetserver/client/__init__.py b/src/packetserver/client/__init__.py index 8269fc6..0f4bd7d 100644 --- a/src/packetserver/client/__init__.py +++ b/src/packetserver/client/__init__.py @@ -54,8 +54,9 @@ class Client: if conn.state.name in ['DISCONNECTED', 'DISCONNECTING']: raise RuntimeError("Connection disconnected unexpectedly.") time.sleep(.1) - logging.debug("Allowing connection to stabilize for 10 seconds") - time.sleep(10) + logging.debug(f"Connection to {dest} ready.") + logging.debug("Allowing connection to stabilize for 5 seconds") + time.sleep(5) return conn def send_and_receive(self, req: Request, conn: PacketServerConnection, timeout: int = 300) -> Optional[Response]: