Adding connection wait for connected status to new_connection.

This commit is contained in:
Michael Woods
2025-02-15 15:49:19 -05:00
parent 811c608213
commit 2c7ecc02e9

View File

@@ -54,8 +54,9 @@ class Client:
if conn.state.name in ['DISCONNECTED', 'DISCONNECTING']: if conn.state.name in ['DISCONNECTED', 'DISCONNECTING']:
raise RuntimeError("Connection disconnected unexpectedly.") raise RuntimeError("Connection disconnected unexpectedly.")
time.sleep(.1) time.sleep(.1)
logging.debug("Allowing connection to stabilize for 10 seconds") logging.debug(f"Connection to {dest} ready.")
time.sleep(10) logging.debug("Allowing connection to stabilize for 5 seconds")
time.sleep(5)
return conn return conn
def send_and_receive(self, req: Request, conn: PacketServerConnection, timeout: int = 300) -> Optional[Response]: def send_and_receive(self, req: Request, conn: PacketServerConnection, timeout: int = 300) -> Optional[Response]: