diff --git a/src/TwitchLib.Communication/Clients/ClientBase.cs b/src/TwitchLib.Communication/Clients/ClientBase.cs index 0dfc91f..e03c0c3 100644 --- a/src/TwitchLib.Communication/Clients/ClientBase.cs +++ b/src/TwitchLib.Communication/Clients/ClientBase.cs @@ -237,9 +237,6 @@ private async Task OpenPrivateAsync(bool isReconnect) return true; } - // Always create new client when opening new connection - Client = CreateClient(); - var first = true; Options.ReconnectionPolicy.Reset(isReconnect); @@ -247,6 +244,10 @@ private async Task OpenPrivateAsync(bool isReconnect) !Options.ReconnectionPolicy.AreAttemptsComplete()) { Logger?.TraceAction(GetType(), "try to connect"); + + // Always create new client when opening new connection + Client = CreateClient(); + if (!first) { await Task.Delay(Options.ReconnectionPolicy.GetReconnectInterval(), CancellationToken.None);