From 5c603a636c4105323128013f6a6590fb63894d69 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 10 Nov 2020 16:06:53 -0700 Subject: [PATCH] stop AutoReconnect on initial connect also corrected a debug call to add the key --- Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs index 7303d01..f151b57 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs @@ -313,7 +313,7 @@ namespace PepperDash.Core void ConnectToServerCallback(TCPClient c) { Debug.Console(1, this, "Server connection result: {0}", c.ClientStatus); - if (c.ClientStatus != SocketStatus.SOCKET_STATUS_CONNECTED) + if (c.ClientStatus != SocketStatus.SOCKET_STATUS_CONNECTED && AutoReconnect) WaitAndTryReconnect(); } @@ -326,7 +326,7 @@ namespace PepperDash.Core if (Client != null) { - Debug.Console(1, "Attempting reconnect, status={0}", Client.ClientStatus); + Debug.Console(1, this, "Attempting reconnect, status={0}", Client.ClientStatus); if (!DisconnectCalledByUser) RetryTimer = new CTimer(o => { Client.ConnectToServerAsync(ConnectToServerCallback); }, AutoReconnectIntervalMs);