diff --git a/arduino/libraries/WiFi/src/WiFiClient.cpp b/arduino/libraries/WiFi/src/WiFiClient.cpp index b4c43048..b3b6acaa 100644 --- a/arduino/libraries/WiFi/src/WiFiClient.cpp +++ b/arduino/libraries/WiFi/src/WiFiClient.cpp @@ -87,15 +87,10 @@ size_t WiFiClient::write(const uint8_t *buf, size_t size) return 0; } - int result = lwip_send_r(_socket, (void*)buf, size, MSG_DONTWAIT); - - if (result < 0) { - lwip_close_r(_socket); - _socket = -1; - return 0; - } + int result = lwip_send_r(_socket, (void*)buf, size, MSG_PEEK); return result; + } int WiFiClient::available()