diff --git a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino index 6634a53e6e..c0e3ee6d73 100644 --- a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino +++ b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino @@ -85,7 +85,7 @@ void loop() { } // Read all the lines of the reply from server and print them to Serial - while (client.available()) { + while (client.available() || client.connected()) { String line = client.readStringUntil('\r'); Serial.print(line); }