From 93b7ebffaa653ec3684743f8c8bd01f667c9cdae Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 15 Feb 2022 17:31:34 +0100 Subject: [PATCH] pstats: PStatClient.connect() should wait for UDP connection to be established This makes the behavior of PStats more predictable, reducing missed frames at the beginning --- panda/src/pstatclient/pStatClientImpl.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panda/src/pstatclient/pStatClientImpl.cxx b/panda/src/pstatclient/pStatClientImpl.cxx index 02f1764b81..85d7e45f27 100644 --- a/panda/src/pstatclient/pStatClientImpl.cxx +++ b/panda/src/pstatclient/pStatClientImpl.cxx @@ -124,6 +124,11 @@ client_connect(std::string hostname, int port) { MutexDebug::increment_pstats(); #endif // DEBUG_THREADS + // Wait for the server hello. + while (!_got_udp_port) { + transmit_control_data(); + } + return _is_connected; }