From 2084d8811755bffcf01d7b8be74e09bc1614c70b Mon Sep 17 00:00:00 2001 From: szporowolik Date: Mon, 21 Oct 2019 16:47:26 +0200 Subject: [PATCH] Keep alive information added to logs --- 02_Windows_App/Perun_v1/01_Classes/TCPController.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/02_Windows_App/Perun_v1/01_Classes/TCPController.cs b/02_Windows_App/Perun_v1/01_Classes/TCPController.cs index f781268..759b3da 100644 --- a/02_Windows_App/Perun_v1/01_Classes/TCPController.cs +++ b/02_Windows_App/Perun_v1/01_Classes/TCPController.cs @@ -122,11 +122,11 @@ public class TCPController dynamic dynamicRawTCPFrame = JsonConvert.DeserializeObject(strReceivedData); // Deserialize received frame string strRawTCPFrameType = dynamicRawTCPFrame.type; - PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP packet received, type: " + strRawTCPFrameType,2); - - // Add to mySQL send buffer (find first empty slot) + // Check if this is NOT keep alive if (Int32.Parse(strRawTCPFrameType) != 0) { + // Add to mySQL send buffer (find first empty slot) + PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "TCP packet received, type: " + strRawTCPFrameType, 2); for (int i = 0; i < arrMySQLSendBuffer.Length - 1; i++) { if (arrMySQLSendBuffer[i] == null) @@ -135,6 +135,10 @@ public class TCPController break; } } + } else + { + // Keep alive + PerunHelper.GUILogHistoryAdd(ref arrGUILogHistory, "Keep-alive received", 2); } } else