From 6b10bd6c519bb9f88948740d494f73ed6555481c Mon Sep 17 00:00:00 2001 From: Chris Marsh Date: Fri, 28 Jul 2017 09:45:11 -0700 Subject: [PATCH] Explain backoff --- src/discord-rpc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/discord-rpc.cpp b/src/discord-rpc.cpp index fc2e929..3c5e4e2 100644 --- a/src/discord-rpc.cpp +++ b/src/discord-rpc.cpp @@ -38,6 +38,8 @@ static QueuedMessage SendQueue[MessageQueueSize]{}; static std::atomic_uint SendQueueNextAdd{0}; static std::atomic_uint SendQueueNextSend{0}; static std::atomic_uint SendQueuePendingSends{0}; +// We want to auto connect, and retry on failure, but not as fast as possible. This does expoential +// backoff from 0.5 seconds to 1 minute static Backoff ReconnectTimeMs(500, 60 * 1000); static auto NextConnect{std::chrono::system_clock::now()}; static int Pid{0};