From c500c326f3e476ad4327bf8d686befbf5d0715d1 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 24 Aug 2016 13:02:35 +0200 Subject: [PATCH] Add a sleep into remote server status checks so back-to-back checks work * Without this sleep, a second CheckStatus() could actually receive a busy signal on localhost (or a sufficiently fast connection or slow computer) because the last client hang-up hasn't completed by the time the next connection comes in. --- renderdocui/Code/PersistantConfig.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/renderdocui/Code/PersistantConfig.cs b/renderdocui/Code/PersistantConfig.cs index 399c68ea3..7324ebb9b 100644 --- a/renderdocui/Code/PersistantConfig.cs +++ b/renderdocui/Code/PersistantConfig.cs @@ -68,6 +68,14 @@ namespace renderdocui.Code ServerRunning = true; VersionMismatch = Busy = false; server.ShutdownConnection(); + + // since we can only have one active client at once on a remote server, we need + // to avoid DDOS'ing by doing multiple CheckStatus() one after the other so fast + // that the active client can't be properly shut down. Sleeping here for a short + // time gives that breathing room. + // Not the most elegant solution, but it is simple + + Thread.Sleep(15); } catch (ReplayCreateException ex) {