From fdb04286d6f11a3fa3780332b0f95590e86353b5 Mon Sep 17 00:00:00 2001 From: Jonathan Arndt Date: Sun, 23 Mar 2025 16:36:41 -0700 Subject: [PATCH] fix: correct event subscription logic in GenericCommunicationMonitor and poll inclusively. --- .../Monitoring/GenericCommunicationMonitor.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/PepperDash.Essentials.Core/Monitoring/GenericCommunicationMonitor.cs b/src/PepperDash.Essentials.Core/Monitoring/GenericCommunicationMonitor.cs index aad8120d..094cdb22 100644 --- a/src/PepperDash.Essentials.Core/Monitoring/GenericCommunicationMonitor.cs +++ b/src/PepperDash.Essentials.Core/Monitoring/GenericCommunicationMonitor.cs @@ -151,17 +151,16 @@ namespace PepperDash.Essentials.Core { if (MonitorBytesReceived) { - Client.BytesReceived += Client_BytesReceived; + Client.BytesReceived -= Client_BytesReceived; + Client.BytesReceived += Client_BytesReceived; } else { + Client.TextReceived -= Client_TextReceived; Client.TextReceived += Client_TextReceived; } - if (!IsSocket) - { - BeginPolling(); - } + BeginPolling(); } void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)