From 6a813061668e5d014f74e7bc247fecd14b6982ce Mon Sep 17 00:00:00 2001 From: Jason T Alborough <> Date: Fri, 8 Nov 2019 11:20:40 -0500 Subject: [PATCH 1/3] Changes general status debug messages from level 1 to level 2 in Tcp Clients for Server --- Pepperdash Core/._Pepperdash Core.sln | Bin 0 -> 4096 bytes .../GenericSecureTcpIpClient_ForServer.cs | 22 +++++++++--------- .../Comm/GenericTcpIpClient_ForServer.cs | 22 +++++++++--------- 3 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 Pepperdash Core/._Pepperdash Core.sln diff --git a/Pepperdash Core/._Pepperdash Core.sln b/Pepperdash Core/._Pepperdash Core.sln new file mode 100644 index 0000000000000000000000000000000000000000..27148e75b691d931d3a2720e9e698e463729c436 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103va^0Vm z0nx#*0H|C5O$#HC4;7b6&d=3LEGWoH)yqjNE-5WeO-V^CNmULA2I*m+d^8qBAGx?f z4MdNE(GVC7fzc2c4S~@R7!85Z5Eu=C(GVC7fzc2c4S~@Rz!d_Z&L#+hfm}#NX0bw1 zYH@yPQF5w6T7FTsLS|k`YF { - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "ConnectToServerAsync Count:{0} Ran!", ConnectionCount); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "ConnectToServerAsync Count:{0} Ran!", ConnectionCount); if (ConnectFailTimer != null) { @@ -453,7 +453,7 @@ namespace PepperDash.Core if (o.ClientStatus == SocketStatus.SOCKET_STATUS_CONNECTED) { - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Client connected to {0} on port {1}", o.AddressClientConnectedTo, o.LocalPortNumberOfClient); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Client connected to {0} on port {1}", o.AddressClientConnectedTo, o.LocalPortNumberOfClient); o.ReceiveDataAsync(Receive); if (SharedKeyRequired) @@ -526,7 +526,7 @@ namespace PepperDash.Core if (Client != null) { //SecureClient.DisconnectFromServer(); - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Disconnecting Client {0}", DisconnectCalledByUser ? ", Called by user" : ""); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Disconnecting Client {0}", DisconnectCalledByUser ? ", Called by user" : ""); Client.SocketStatusChange -= Client_SocketStatusChange; Client.Dispose(); Client = null; @@ -548,14 +548,14 @@ namespace PepperDash.Core { if (Client != null) { - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Cleaning up remotely closed/failed connection."); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Cleaning up remotely closed/failed connection."); Cleanup(); } if (!DisconnectCalledByUser && AutoReconnect) { var halfInterval = AutoReconnectIntervalMs / 2; var rndTime = new Random().Next(-halfInterval, halfInterval) + AutoReconnectIntervalMs; - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Attempting reconnect in {0} ms, randomized", rndTime); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Attempting reconnect in {0} ms, randomized", rndTime); if (RetryTimer != null) { RetryTimer.Stop(); @@ -588,7 +588,7 @@ namespace PepperDash.Core if (SharedKeyRequired && str == "SharedKey:") { - Debug.Console(1, this, "Server asking for shared key, sending"); + Debug.Console(2, this, "Server asking for shared key, sending"); SendText(SharedKey + "\n"); } else if (SharedKeyRequired && str == "Shared Key Match") @@ -596,7 +596,7 @@ namespace PepperDash.Core StopWaitForSharedKeyTimer(); - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication"); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication"); OnClientReadyForcommunications(true); // Successful key exchange } else @@ -727,7 +727,7 @@ namespace PepperDash.Core { HeartbeatAckTimer = new CTimer(HeartbeatAckTimerFail, null, (HeartbeatInterval * 2), (HeartbeatInterval * 2)); } - Debug.Console(1, this, "Heartbeat Received: {0}, from Server", HeartbeatString); + Debug.Console(2, this, "Heartbeat Received: {0}, from Server", HeartbeatString); return remainingText; } } @@ -835,7 +835,7 @@ namespace PepperDash.Core } try { - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus)); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus)); OnConnectionChange(); // The client could be null or disposed by this time... diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient_ForServer.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient_ForServer.cs index ec59259..cc72c43 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient_ForServer.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient_ForServer.cs @@ -282,7 +282,7 @@ namespace PepperDash.Core public void Connect() { ConnectionCount++; - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Attempting connect Count:{0}", ConnectionCount); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Attempting connect Count:{0}", ConnectionCount); if (IsConnected) @@ -352,10 +352,10 @@ namespace PepperDash.Core } }, 30000); - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Making Connection Count:{0}", ConnectionCount); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Making Connection Count:{0}", ConnectionCount); Client.ConnectToServerAsync(o => { - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "ConnectToServerAsync Count:{0} Ran!", ConnectionCount); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "ConnectToServerAsync Count:{0} Ran!", ConnectionCount); if (ConnectFailTimer != null) { @@ -365,7 +365,7 @@ namespace PepperDash.Core if (o.ClientStatus == SocketStatus.SOCKET_STATUS_CONNECTED) { - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Client connected to {0} on port {1}", o.AddressClientConnectedTo, o.LocalPortNumberOfClient); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Client connected to {0} on port {1}", o.AddressClientConnectedTo, o.LocalPortNumberOfClient); o.ReceiveDataAsync(Receive); if (SharedKeyRequired) @@ -438,7 +438,7 @@ namespace PepperDash.Core if (Client != null) { //SecureClient.DisconnectFromServer(); - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Disconnecting Client {0}", DisconnectCalledByUser ? ", Called by user" : ""); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Disconnecting Client {0}", DisconnectCalledByUser ? ", Called by user" : ""); Client.SocketStatusChange -= Client_SocketStatusChange; Client.Dispose(); Client = null; @@ -460,14 +460,14 @@ namespace PepperDash.Core { if (Client != null) { - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Cleaning up remotely closed/failed connection."); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Cleaning up remotely closed/failed connection."); Cleanup(); } if (!DisconnectCalledByUser && AutoReconnect) { var halfInterval = AutoReconnectIntervalMs / 2; var rndTime = new Random().Next(-halfInterval, halfInterval) + AutoReconnectIntervalMs; - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Attempting reconnect in {0} ms, randomized", rndTime); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Attempting reconnect in {0} ms, randomized", rndTime); if (RetryTimer != null) { RetryTimer.Stop(); @@ -497,13 +497,13 @@ namespace PepperDash.Core { if (SharedKeyRequired && str == "SharedKey:") { - Debug.Console(1, this, "Server asking for shared key, sending"); + Debug.Console(2, this, "Server asking for shared key, sending"); SendText(SharedKey + "\n"); } else if (SharedKeyRequired && str == "Shared Key Match") { StopWaitForSharedKeyTimer(); - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication"); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication"); OnClientReadyForcommunications(true); // Successful key exchange } else @@ -588,7 +588,7 @@ namespace PepperDash.Core { HeartbeatAckTimer = new CTimer(HeartbeatAckTimerFail, null, (HeartbeatInterval * 2), (HeartbeatInterval * 2)); } - Debug.Console(1, this, "Heartbeat Received: {0}, from Server", HeartbeatString); + Debug.Console(2, this, "Heartbeat Received: {0}, from Server", HeartbeatString); return remainingText; } } @@ -696,7 +696,7 @@ namespace PepperDash.Core } try { - Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus)); + Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus)); OnConnectionChange(); From aa0ec2684cb457927c01ecfdcc116e86b88fc544 Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Fri, 8 Nov 2019 12:58:27 -0500 Subject: [PATCH 2/3] Removes bad SLN file --- Pepperdash Core/._Pepperdash Core.sln | Bin 4096 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Pepperdash Core/._Pepperdash Core.sln diff --git a/Pepperdash Core/._Pepperdash Core.sln b/Pepperdash Core/._Pepperdash Core.sln deleted file mode 100644 index 27148e75b691d931d3a2720e9e698e463729c436..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103va^0Vm z0nx#*0H|C5O$#HC4;7b6&d=3LEGWoH)yqjNE-5WeO-V^CNmULA2I*m+d^8qBAGx?f z4MdNE(GVC7fzc2c4S~@R7!85Z5Eu=C(GVC7fzc2c4S~@Rz!d_Z&L#+hfm}#NX0bw1 zYH@yPQF5w6T7FTsLS|k`YF Date: Tue, 12 Nov 2019 17:26:15 -0500 Subject: [PATCH 3/3] Really removes general status debug messages from level 1 to level 2 in Tcp Clients for Server --- .../GenericSecureTcpIpClient_ForServer.cs | 24 +++++++++---------- .../Comm/GenericTcpIpClient_ForServer.cs | 24 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericSecureTcpIpClient_ForServer.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericSecureTcpIpClient_ForServer.cs index 3aac4b3..53468a8 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericSecureTcpIpClient_ForServer.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericSecureTcpIpClient_ForServer.cs @@ -370,7 +370,7 @@ namespace PepperDash.Core public void Connect() { ConnectionCount++; - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Attempting connect Count:{0}", ConnectionCount); + Debug.Console(2, this, "Attempting connect Count:{0}", ConnectionCount); if (IsConnected) @@ -440,10 +440,10 @@ namespace PepperDash.Core } }, 30000); - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Making Connection Count:{0}", ConnectionCount); + Debug.Console(2, this, "Making Connection Count:{0}", ConnectionCount); Client.ConnectToServerAsync(o => { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "ConnectToServerAsync Count:{0} Ran!", ConnectionCount); + Debug.Console(2, this, "ConnectToServerAsync Count:{0} Ran!", ConnectionCount); if (ConnectFailTimer != null) { @@ -453,7 +453,7 @@ namespace PepperDash.Core if (o.ClientStatus == SocketStatus.SOCKET_STATUS_CONNECTED) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Client connected to {0} on port {1}", o.AddressClientConnectedTo, o.LocalPortNumberOfClient); + Debug.Console(2, this, "Client connected to {0} on port {1}", o.AddressClientConnectedTo, o.LocalPortNumberOfClient); o.ReceiveDataAsync(Receive); if (SharedKeyRequired) @@ -526,7 +526,7 @@ namespace PepperDash.Core if (Client != null) { //SecureClient.DisconnectFromServer(); - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Disconnecting Client {0}", DisconnectCalledByUser ? ", Called by user" : ""); + Debug.Console(2, this, "Disconnecting Client {0}", DisconnectCalledByUser ? ", Called by user" : ""); Client.SocketStatusChange -= Client_SocketStatusChange; Client.Dispose(); Client = null; @@ -548,14 +548,14 @@ namespace PepperDash.Core { if (Client != null) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Cleaning up remotely closed/failed connection."); + Debug.Console(2, this, "Cleaning up remotely closed/failed connection."); Cleanup(); } if (!DisconnectCalledByUser && AutoReconnect) { var halfInterval = AutoReconnectIntervalMs / 2; var rndTime = new Random().Next(-halfInterval, halfInterval) + AutoReconnectIntervalMs; - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Attempting reconnect in {0} ms, randomized", rndTime); + Debug.Console(2, this, "Attempting reconnect in {0} ms, randomized", rndTime); if (RetryTimer != null) { RetryTimer.Stop(); @@ -596,7 +596,7 @@ namespace PepperDash.Core StopWaitForSharedKeyTimer(); - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication"); + Debug.Console(2, this, "Shared key confirmed. Ready for communication"); OnClientReadyForcommunications(true); // Successful key exchange } else @@ -669,7 +669,7 @@ namespace PepperDash.Core { if (HeartbeatEnabled) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Starting Heartbeat"); + Debug.Console(2, this, "Starting Heartbeat"); if (HeartbeatSendTimer == null) { @@ -687,13 +687,13 @@ namespace PepperDash.Core if (HeartbeatSendTimer != null) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Stoping Heartbeat Send"); + Debug.Console(2, this, "Stoping Heartbeat Send"); HeartbeatSendTimer.Stop(); HeartbeatSendTimer = null; } if (HeartbeatAckTimer != null) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Stoping Heartbeat Ack"); + Debug.Console(2, this, "Stoping Heartbeat Ack"); HeartbeatAckTimer.Stop(); HeartbeatAckTimer = null; } @@ -835,7 +835,7 @@ namespace PepperDash.Core } try { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus)); + Debug.Console(2, this, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus)); OnConnectionChange(); // The client could be null or disposed by this time... diff --git a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient_ForServer.cs b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient_ForServer.cs index cc72c43..b00c0a0 100644 --- a/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient_ForServer.cs +++ b/Pepperdash Core/Pepperdash Core/Comm/GenericTcpIpClient_ForServer.cs @@ -282,7 +282,7 @@ namespace PepperDash.Core public void Connect() { ConnectionCount++; - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Attempting connect Count:{0}", ConnectionCount); + Debug.Console(2, this, "Attempting connect Count:{0}", ConnectionCount); if (IsConnected) @@ -352,10 +352,10 @@ namespace PepperDash.Core } }, 30000); - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Making Connection Count:{0}", ConnectionCount); + Debug.Console(2, this, "Making Connection Count:{0}", ConnectionCount); Client.ConnectToServerAsync(o => { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "ConnectToServerAsync Count:{0} Ran!", ConnectionCount); + Debug.Console(2, this, "ConnectToServerAsync Count:{0} Ran!", ConnectionCount); if (ConnectFailTimer != null) { @@ -365,7 +365,7 @@ namespace PepperDash.Core if (o.ClientStatus == SocketStatus.SOCKET_STATUS_CONNECTED) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Client connected to {0} on port {1}", o.AddressClientConnectedTo, o.LocalPortNumberOfClient); + Debug.Console(2, this, "Client connected to {0} on port {1}", o.AddressClientConnectedTo, o.LocalPortNumberOfClient); o.ReceiveDataAsync(Receive); if (SharedKeyRequired) @@ -438,7 +438,7 @@ namespace PepperDash.Core if (Client != null) { //SecureClient.DisconnectFromServer(); - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Disconnecting Client {0}", DisconnectCalledByUser ? ", Called by user" : ""); + Debug.Console(2, this, "Disconnecting Client {0}", DisconnectCalledByUser ? ", Called by user" : ""); Client.SocketStatusChange -= Client_SocketStatusChange; Client.Dispose(); Client = null; @@ -460,14 +460,14 @@ namespace PepperDash.Core { if (Client != null) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Cleaning up remotely closed/failed connection."); + Debug.Console(2, this, "Cleaning up remotely closed/failed connection."); Cleanup(); } if (!DisconnectCalledByUser && AutoReconnect) { var halfInterval = AutoReconnectIntervalMs / 2; var rndTime = new Random().Next(-halfInterval, halfInterval) + AutoReconnectIntervalMs; - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Attempting reconnect in {0} ms, randomized", rndTime); + Debug.Console(2, this, "Attempting reconnect in {0} ms, randomized", rndTime); if (RetryTimer != null) { RetryTimer.Stop(); @@ -503,7 +503,7 @@ namespace PepperDash.Core else if (SharedKeyRequired && str == "Shared Key Match") { StopWaitForSharedKeyTimer(); - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Shared key confirmed. Ready for communication"); + Debug.Console(2, this, "Shared key confirmed. Ready for communication"); OnClientReadyForcommunications(true); // Successful key exchange } else @@ -530,7 +530,7 @@ namespace PepperDash.Core { if (HeartbeatEnabled) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Starting Heartbeat"); + Debug.Console(2, this, "Starting Heartbeat"); if (HeartbeatSendTimer == null) { @@ -548,13 +548,13 @@ namespace PepperDash.Core if (HeartbeatSendTimer != null) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Stoping Heartbeat Send"); + Debug.Console(2, this, "Stoping Heartbeat Send"); HeartbeatSendTimer.Stop(); HeartbeatSendTimer = null; } if (HeartbeatAckTimer != null) { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Stoping Heartbeat Ack"); + Debug.Console(2, this, "Stoping Heartbeat Ack"); HeartbeatAckTimer.Stop(); HeartbeatAckTimer = null; } @@ -696,7 +696,7 @@ namespace PepperDash.Core } try { - Debug.Console(2, this, Debug.ErrorLogLevel.Notice, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus)); + Debug.Console(2, this, "Socket status change: {0} ({1})", client.ClientStatus, (ushort)(client.ClientStatus)); OnConnectionChange();