From 64b0250cd14c5b6f650a7f973d3da664f629ef0e Mon Sep 17 00:00:00 2001 From: Fedor Indutny <238531+indutny@users.noreply.github.com> Date: Mon, 8 Jun 2026 15:01:54 -0700 Subject: [PATCH] Fix sockets not closing properly by connected() When checking `client.connected()` it would set `_sock` to `255` internally, but won't actually communicate back to NINA that the fd is closed so it won't be able to be reused. --- src/WiFiClient.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/WiFiClient.cpp b/src/WiFiClient.cpp index bb72a7c..4f1c200 100644 --- a/src/WiFiClient.cpp +++ b/src/WiFiClient.cpp @@ -302,8 +302,7 @@ uint8_t WiFiClient::connected() { (s == CLOSE_WAIT)); if (result == 0) { - WiFiSocketBuffer.close(_sock); - _sock = 255; + stop(); } return result;