diff --git a/libraries/WiFi/src/WiFiClient.cpp b/libraries/WiFi/src/WiFiClient.cpp index a92dadb2..e422b636 100644 --- a/libraries/WiFi/src/WiFiClient.cpp +++ b/libraries/WiFi/src/WiFiClient.cpp @@ -495,8 +495,8 @@ uint8_t WiFiClient::connected() int res = recv(fd(), &dummy, 0, MSG_DONTWAIT); // avoid unused var warning by gcc (void)res; - // recv only sets errno if res is -1 - if (res < 0){ + // recv only sets errno if res is <= 0 + if (res <= 0){ switch (errno) { case EWOULDBLOCK: case ENOENT: //caused by vfs