diff --git a/src/PepperDash.Core/Comm/GenericSshClient.cs b/src/PepperDash.Core/Comm/GenericSshClient.cs index c24ea829..b95aeb86 100644 --- a/src/PepperDash.Core/Comm/GenericSshClient.cs +++ b/src/PepperDash.Core/Comm/GenericSshClient.cs @@ -278,7 +278,7 @@ namespace PepperDash.Core if (shellStream.DataAvailable) { // empty the buffer if there is data - string str = shellStream.Read(); + shellStream.Read(); } shellStream.DataReceived += Stream_DataReceived; this.LogInformation("Connected"); @@ -287,8 +287,7 @@ namespace PepperDash.Core } catch (SshConnectionException e) { - var ie = e.InnerException; // The details are inside!! - var errorLogLevel = disconnectLogged == true ? Debug.ErrorLogLevel.None : Debug.ErrorLogLevel.Error; + var ie = e.InnerException; // The details are inside!! if (ie is SocketException) { @@ -335,7 +334,6 @@ namespace PepperDash.Core } catch (Exception e) { - var errorLogLevel = disconnectLogged == true ? Debug.ErrorLogLevel.None : Debug.ErrorLogLevel.Error; this.LogError("Unhandled exception on connect: {error}", e.Message); this.LogVerbose(e, "Exception details: "); disconnectLogged = true; @@ -518,7 +516,7 @@ namespace PepperDash.Core this.LogError("ObjectDisposedException sending '{message}'. Restarting connection...", text.Trim()); KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED); - StopReconnectTimer(); + StartReconnectTimer(); } catch (Exception ex) { @@ -551,7 +549,7 @@ namespace PepperDash.Core this.LogException(ex, "ObjectDisposedException sending {message}", ComTextHelper.GetEscapedText(bytes)); KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED); - StopReconnectTimer(); + StartReconnectTimer(); } catch (Exception ex) { diff --git a/src/PepperDash.Core/Comm/GenericTcpIpClient.cs b/src/PepperDash.Core/Comm/GenericTcpIpClient.cs index 96d0387a..d13eed3f 100644 --- a/src/PepperDash.Core/Comm/GenericTcpIpClient.cs +++ b/src/PepperDash.Core/Comm/GenericTcpIpClient.cs @@ -477,8 +477,7 @@ namespace PepperDash.Core /// public void SendBytes(byte[] bytes) { - if (StreamDebugging.TxStreamDebuggingIsEnabled) - Debug.Console(0, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + this.PrintSentBytes(bytes); if (_client != null) _client.SendData(bytes, bytes.Length); } diff --git a/src/PepperDash.Core/Comm/StreamDebuggingExtensionMethods.cs b/src/PepperDash.Core/Comm/StreamDebuggingExtensions.cs similarity index 100% rename from src/PepperDash.Core/Comm/StreamDebuggingExtensionMethods.cs rename to src/PepperDash.Core/Comm/StreamDebuggingExtensions.cs diff --git a/src/PepperDash.Core/Comm/eStreamDebuggingDataTypeSettings.cs b/src/PepperDash.Core/Comm/eStreamDebuggingDataTypeSettings.cs index 24bd18d5..44626203 100644 --- a/src/PepperDash.Core/Comm/eStreamDebuggingDataTypeSettings.cs +++ b/src/PepperDash.Core/Comm/eStreamDebuggingDataTypeSettings.cs @@ -19,6 +19,6 @@ namespace PepperDash.Core /// /// Debug data in both byte and text formats /// - Both = Bytes | Text, + Both = Bytes | Text } }