From b632088b19c90d4fd0f8713337b777d83f762c13 Mon Sep 17 00:00:00 2001 From: travis-farmer Date: Fri, 3 Nov 2023 09:06:42 -0400 Subject: [PATCH] cleaning... --- Wifi_NINA.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Wifi_NINA.cpp b/Wifi_NINA.cpp index 19efc14..1ae888b 100644 --- a/Wifi_NINA.cpp +++ b/Wifi_NINA.cpp @@ -390,7 +390,7 @@ void WifiNINA::checkForLostClients() { if(c && !c->connected()) { DIAG(F("Remove client %d"), clientId); CommandDistributor::forget(clientId); - //delete c; // we have now finished with this client + //delete c; // this causes a crash when client drops.. commenting out for now clients[clientId]=nullptr; } } @@ -412,24 +412,22 @@ void WifiNINA::checkForClientInput() { } } } + void WifiNINA::checkForClientOutput() { // something to write out? auto clientId=outboundRing->read(); if (clientId < 0) return; auto replySize=outboundRing->count(); if (replySize==0) return; // nothing to send - auto c=clients[clientId]; if (!c) { // client is gone, throw away msg for (int i=0;iread(); return; } - // emit data to the client object // This should work in theory, the for (int i=0;iwrite(outboundRing->read()); - } void WifiNINA::loop() {