From 0c950404d6fd85672999a3d31c5433cbe1a6d72f Mon Sep 17 00:00:00 2001 From: Alex Johnson Date: Tue, 8 Feb 2022 16:21:55 -0500 Subject: [PATCH 1/2] Removes ReconnectTimer = null action from HandleConnectionFailure timer event and moves some debug to level 1 for better visibility. --- .../Pepperdash Core/Comm/GenericSshClient.cs | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs index 515c226..61565d4 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericSshClient.cs @@ -319,31 +319,26 @@ namespace PepperDash.Core /// void HandleConnectionFailure() { - KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED); - - Debug.Console(2, this, "Client nulled due to connection failure. AutoReconnect: {0}, ConnectEnabled: {1}", AutoReconnect, ConnectEnabled); - - if (AutoReconnect && ConnectEnabled) - { - Debug.Console(2, this, "Checking autoreconnect: {0}, {1}ms", - AutoReconnect, AutoReconnectIntervalMs); - if (ReconnectTimer == null)// || !ReconnectTimerRunning) - { - ReconnectTimer = new CTimer(o => - { - Connect(); - ReconnectTimer = null; - }, AutoReconnectIntervalMs); - Debug.Console(1, this, "Attempting connection in {0} seconds", - (float)(AutoReconnectIntervalMs / 1000)); - } - else - { - Debug.Console(2, this, "{0} second reconnect cycle running", - (float)(AutoReconnectIntervalMs / 1000)); - } - } + Debug.Console(1, this, "Client nulled due to connection failure. AutoReconnect: {0}, ConnectEnabled: {1}", AutoReconnect, ConnectEnabled); + if (AutoReconnect && ConnectEnabled) + { + Debug.Console(1, this, "Checking autoreconnect: {0}, {1}ms", AutoReconnect, AutoReconnectIntervalMs); + if (ReconnectTimer == null) + { + ReconnectTimer = new CTimer(o => + { + Connect(); + }, AutoReconnectIntervalMs); + Debug.Console(1, this, "Attempting connection in {0} seconds", + (float)(AutoReconnectIntervalMs / 1000)); + } + else + { + Debug.Console(1, this, "{0} second reconnect cycle running", + (float)(AutoReconnectIntervalMs / 1000)); + } + } } /// @@ -446,7 +441,7 @@ namespace PepperDash.Core } else { - Debug.Console(2, this, "Client is null or disconnected. Cannot Send Text"); + Debug.Console(1, this, "Client is null or disconnected. Cannot Send Text"); } } catch (Exception ex) @@ -478,7 +473,7 @@ namespace PepperDash.Core } else { - Debug.Console(2, this, "Client is null or disconnected. Cannot Send Bytes"); + Debug.Console(1, this, "Client is null or disconnected. Cannot Send Bytes"); } } catch From f04536f2aa32eb48790effd920eeca87070dea76 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 9 Feb 2022 09:03:51 -0700 Subject: [PATCH 2/2] ci: Update runners to `windows-2019` --- .github/workflows/docker.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5449af9..f71cf3a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,7 +21,7 @@ env: RELEASE_BRANCH: main jobs: Build_Project: - runs-on: windows-latest + runs-on: windows-2019 steps: # First we checkout the source repo - name: Checkout repo diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5acc7a8..25bb227 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ env: RELEASE_BRANCH: main jobs: Build_Project: - runs-on: windows-latest + runs-on: windows-2019 steps: # First we checkout the source repo - name: Checkout repo