From 6816c1e0067f271e7ea169a20e0fdebc98641c85 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 11 Jul 2022 07:32:52 -0400 Subject: [PATCH] Better limit on BeefPerf connection waiting --- BeefySysLib/util/BeefPerf.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BeefySysLib/util/BeefPerf.cpp b/BeefySysLib/util/BeefPerf.cpp index 49ffeef1..e1dae1c1 100644 --- a/BeefySysLib/util/BeefPerf.cpp +++ b/BeefySysLib/util/BeefPerf.cpp @@ -757,10 +757,15 @@ bool BpManager::Connect() if (mShutdownEvent.WaitFor(0)) { // We are shutting down - have we waited enough? - int minWaitMS = isLocalhost ? 50 : 20*1000; + int minWaitMS = isLocalhost ? 50 : 5*1000; if (totalWaitedMS >= minWaitMS) return false; } + + // We don't want to wait too long, otherwise we will buffer up too much + int maxWaitMS = isLocalhost ? 5*1000 : 15*1000; + if (totalWaitedMS >= maxWaitMS) + return false; } return true;