mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-06 05:21:22 +03:00
replace delay with while loop in WiFiClient.ino
This commit is contained in:
parent
1368a82a82
commit
6fa70bda01
@ -71,7 +71,13 @@ void loop() {
|
|||||||
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
|
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
|
||||||
"Host: " + host + "\r\n" +
|
"Host: " + host + "\r\n" +
|
||||||
"Connection: close\r\n\r\n");
|
"Connection: close\r\n\r\n");
|
||||||
delay(10);
|
while (client.available() == 0) {
|
||||||
|
if (timeout - millis() < 0) {
|
||||||
|
Serial.println(">>> Client Timeout !");
|
||||||
|
client.stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Read all the lines of the reply from server and print them to Serial
|
// Read all the lines of the reply from server and print them to Serial
|
||||||
while(client.available()){
|
while(client.available()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user