diff --git a/WiFi/examples/WifiCosmClient/WifiCosmClient.ino b/WiFi/examples/WifiCosmClient/WifiCosmClient.ino index cc456a14e..cac43c06d 100644 --- a/WiFi/examples/WifiCosmClient/WifiCosmClient.ino +++ b/WiFi/examples/WifiCosmClient/WifiCosmClient.ino @@ -81,7 +81,7 @@ void loop() { // if there's incoming data from the net connection. // send it out the serial port. This is for debugging // purposes only: - if (client.available()) { + while (client.available()) { char c = client.read(); Serial.print(c); } diff --git a/WiFi/examples/WifiCosmClientString/WifiCosmClientString.ino b/WiFi/examples/WifiCosmClientString/WifiCosmClientString.ino index a7b0b223f..0c78a638c 100644 --- a/WiFi/examples/WifiCosmClientString/WifiCosmClientString.ino +++ b/WiFi/examples/WifiCosmClientString/WifiCosmClientString.ino @@ -95,7 +95,7 @@ void loop() { // if there's incoming data from the net connection. // send it out the serial port. This is for debugging // purposes only: - if (client.available()) { + while (client.available()) { char c = client.read(); Serial.print(c); }