mirror of
https://github.com/KevinMidboe/TinyGSM.git
synced 2025-10-29 18:00:18 +00:00
Ensure that ALL variants of read respect timeout
This commit is contained in:
@@ -517,7 +517,8 @@ protected:
|
||||
sockets[mux]->sock_available = len;
|
||||
|
||||
for (size_t i=0; i<len; i++) {
|
||||
while (!stream.available()) { TINY_GSM_YIELD(); }
|
||||
uint32_t startMillis = millis();
|
||||
while (!stream.available() && (millis() - startMillis < sockets[mux]->_timeout)) { TINY_GSM_YIELD(); }
|
||||
char c = stream.read();
|
||||
sockets[mux]->rx.put(c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user