diff --git a/WifiESP32.cpp b/WifiESP32.cpp index 22a02ca..917785e 100644 --- a/WifiESP32.cpp +++ b/WifiESP32.cpp @@ -236,6 +236,17 @@ void WifiESP::loop() { if (clientId >= 0) { if ((unsigned int)clientId > clients.size()) { // something is wrong with the ringbuffer position + // or client has disconnected + outboundRing->info(); + // try to recover by reading out to nowhere + int count=outboundRing->count(); + for(int i=0;iread(); + if (c < 0) { + DIAG(F("Ringread fail at %d"),i); + break; + } + } outboundRing->info(); } else { // we have data to send in outboundRing