From e131a9cce8b65fe08771ed0699ffc9db73fd6861 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sat, 2 Nov 2024 21:25:21 +0100 Subject: [PATCH] Ethernet: Reject additonal connection instead of looping on OVERFLOW --- EthernetInterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index f8306cb..1e49a21 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -144,7 +144,9 @@ void EthernetInterface::acceptClient() { // STM32 version return; } } - DIAG(F("Ethernet OVERFLOW")); + // reached here only if more than MAX_SOCK_NUM clients want to connect + DIAG(F("Ethernet more than %d clients, not accepting new connection"), MAX_SOCK_NUM); + client.stop(); } #else void EthernetInterface::acceptClient() { // non-STM32 version