From a47a2ff92b5283a7a11e00a44f9c8460e43cc9e4 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 12 Jul 2025 13:17:15 +0200 Subject: [PATCH] Fix code ping FTP/Shelly --- IOB-WIN-FTP/Iob/Ftp.cs | 6 +++--- IOB-WIN-SHELLY/Iob/ShellyClient.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/IOB-WIN-FTP/Iob/Ftp.cs b/IOB-WIN-FTP/Iob/Ftp.cs index 3eefec1b..69357b23 100644 --- a/IOB-WIN-FTP/Iob/Ftp.cs +++ b/IOB-WIN-FTP/Iob/Ftp.cs @@ -947,12 +947,12 @@ namespace IOB_WIN_FTP.Iob private bool pingStatusOk() { bool answ = false; - int numVal = PingQueue.Count; + long numVal = PingQueue.Count; if (numVal > maxQueuePing / 2) { var listaValori = PingQueue.ToList(); - int numOk = listaValori.Where(x => x == "1").Count(); - int numKo = numVal - numOk; + long numOk = listaValori.Where(x => x == "1").Count(); + long numKo = numVal - numOk; answ = numOk >= numKo; lgTrace($"PING ok per: {numOk} > {numKo}"); } diff --git a/IOB-WIN-SHELLY/Iob/ShellyClient.cs b/IOB-WIN-SHELLY/Iob/ShellyClient.cs index d5df8780..3e459062 100644 --- a/IOB-WIN-SHELLY/Iob/ShellyClient.cs +++ b/IOB-WIN-SHELLY/Iob/ShellyClient.cs @@ -287,12 +287,12 @@ namespace IOB_WIN_SHELLY.Iob private bool pingStatusOk() { bool answ = false; - int numVal = PingQueue.Count; + long numVal = PingQueue.Count; if (numVal > maxQueuePing / 2) { var listaValori = PingQueue.ToList(); - int numOk = listaValori.Where(x => x == "1").Count(); - int numKo = numVal - numOk; + long numOk = listaValori.Where(x => x == "1").Count(); + long numKo = numVal - numOk; answ = numOk >= numKo; lgTrace($"PING ok per: {numOk} > {numKo}"); }