diff --git a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino index eb7c02eff3..6000b7dec6 100644 --- a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino +++ b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino @@ -81,7 +81,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); }