From 514ea6d5713e738b69da1f1e88a7fe7020b31617 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 17 Feb 2021 11:38:31 -0700 Subject: [PATCH] add error log printing for socket status --- .../Pepperdash Core/Comm/GenericTcpIpClient.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs index f151b57..4918bf7 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient.cs @@ -373,14 +373,14 @@ namespace PepperDash.Core /// public void SendText(string text) { + if (StreamDebugging.TxStreamDebuggingIsEnabled) + Debug.Console(0, this, "Sending text: '{0}'", text); + var bytes = Encoding.GetEncoding(28591).GetBytes(text); // Check debug level before processing byte array - if (StreamDebugging.TxStreamDebuggingIsEnabled) - Debug.Console(0, this, "Sending {0} bytes: '{1}'", bytes.Length, ComTextHelper.GetEscapedText(bytes)); + if(Client != null) Client.SendData(bytes, bytes.Length); - - } /// @@ -415,7 +415,7 @@ namespace PepperDash.Core /// void Client_SocketStatusChange(TCPClient client, SocketStatus clientSocketStatus) { - Debug.Console(1, this, "Socket status change {0} ({1})", clientSocketStatus, ClientStatusText); + Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Socket status change {0} ({1})", clientSocketStatus, ClientStatusText); if (client.ClientStatus != SocketStatus.SOCKET_STATUS_CONNECTED && !DisconnectCalledByUser && AutoReconnect) WaitAndTryReconnect();