From 60fb30c0a76774944f4419e946e5679e8ac4c1cf Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 28 Jan 2024 01:47:05 +0100 Subject: [PATCH] set ethernet client to NULL when done with it --- EthernetInterface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index 6d440dd..8b1a643 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -242,8 +242,10 @@ void EthernetInterface::loop2() { if (!clients[socket].connected()) { // stop any clients which disconnect CommandDistributor::forget(socket); clients[socket].stop(); + clients[socket]=NULL; //if (Diag::ETHERNET) DIAG(F("Ethernet: disconnect %d "), socket); + return; // Trick: So that we do not continue in this loop with client that is NULL } int available=clients[socket].available();