mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-04-12 12:06:29 +00:00
Merge pull request #124 from PepperDash/hotfix/ssh-autoreconnect-fix
Removes ReconnectTimer = null action from HandleConnectionFailure tim…
This commit is contained in:
commit
784b3a7756
3 changed files with 23 additions and 28 deletions
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
|
|
@ -21,7 +21,7 @@ env:
|
||||||
RELEASE_BRANCH: main
|
RELEASE_BRANCH: main
|
||||||
jobs:
|
jobs:
|
||||||
Build_Project:
|
Build_Project:
|
||||||
runs-on: windows-latest
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
# First we checkout the source repo
|
# First we checkout the source repo
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
|
|
|
||||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
|
@ -19,7 +19,7 @@ env:
|
||||||
RELEASE_BRANCH: main
|
RELEASE_BRANCH: main
|
||||||
jobs:
|
jobs:
|
||||||
Build_Project:
|
Build_Project:
|
||||||
runs-on: windows-latest
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
# First we checkout the source repo
|
# First we checkout the source repo
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
|
|
|
||||||
|
|
@ -319,31 +319,26 @@ namespace PepperDash.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void HandleConnectionFailure()
|
void HandleConnectionFailure()
|
||||||
{
|
{
|
||||||
|
|
||||||
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
|
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
|
||||||
|
Debug.Console(1, this, "Client nulled due to connection failure. AutoReconnect: {0}, ConnectEnabled: {1}", AutoReconnect, ConnectEnabled);
|
||||||
Debug.Console(2, this, "Client nulled due to connection failure. AutoReconnect: {0}, ConnectEnabled: {1}", AutoReconnect, ConnectEnabled);
|
if (AutoReconnect && ConnectEnabled)
|
||||||
|
{
|
||||||
if (AutoReconnect && ConnectEnabled)
|
Debug.Console(1, this, "Checking autoreconnect: {0}, {1}ms", AutoReconnect, AutoReconnectIntervalMs);
|
||||||
{
|
if (ReconnectTimer == null)
|
||||||
Debug.Console(2, this, "Checking autoreconnect: {0}, {1}ms",
|
{
|
||||||
AutoReconnect, AutoReconnectIntervalMs);
|
ReconnectTimer = new CTimer(o =>
|
||||||
if (ReconnectTimer == null)// || !ReconnectTimerRunning)
|
{
|
||||||
{
|
Connect();
|
||||||
ReconnectTimer = new CTimer(o =>
|
}, AutoReconnectIntervalMs);
|
||||||
{
|
Debug.Console(1, this, "Attempting connection in {0} seconds",
|
||||||
Connect();
|
(float)(AutoReconnectIntervalMs / 1000));
|
||||||
ReconnectTimer = null;
|
}
|
||||||
}, AutoReconnectIntervalMs);
|
else
|
||||||
Debug.Console(1, this, "Attempting connection in {0} seconds",
|
{
|
||||||
(float)(AutoReconnectIntervalMs / 1000));
|
Debug.Console(1, this, "{0} second reconnect cycle running",
|
||||||
}
|
(float)(AutoReconnectIntervalMs / 1000));
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
Debug.Console(2, this, "{0} second reconnect cycle running",
|
|
||||||
(float)(AutoReconnectIntervalMs / 1000));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -446,7 +441,7 @@ namespace PepperDash.Core
|
||||||
}
|
}
|
||||||
else
|
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)
|
catch (Exception ex)
|
||||||
|
|
@ -478,7 +473,7 @@ namespace PepperDash.Core
|
||||||
}
|
}
|
||||||
else
|
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
|
catch
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue