From c7d79f40dd7d13c6bcbf06eb59a62a2049b986e4 Mon Sep 17 00:00:00 2001 From: SRGDamia1 Date: Sun, 15 Oct 2017 21:09:00 -0400 Subject: [PATCH] Fixed read() to not wait on closed socket --- src/TinyGsmClientA6.h | 2 +- src/TinyGsmClientESP8266.h | 2 +- src/TinyGsmClientM590.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/TinyGsmClientA6.h b/src/TinyGsmClientA6.h index fe35b60..6dd9634 100644 --- a/src/TinyGsmClientA6.h +++ b/src/TinyGsmClientA6.h @@ -126,7 +126,7 @@ public: continue; } // TODO: Read directly into user buffer? - if (!rx.size()) { + if (!rx.size() && sock_connected) { at->maintain(); //break; } diff --git a/src/TinyGsmClientESP8266.h b/src/TinyGsmClientESP8266.h index 51e9065..32cec81 100644 --- a/src/TinyGsmClientESP8266.h +++ b/src/TinyGsmClientESP8266.h @@ -108,7 +108,7 @@ public: continue; } // TODO: Read directly into user buffer? - if (!rx.size()) { + if (!rx.size() && sock_connected) { at->maintain(); //break; } diff --git a/src/TinyGsmClientM590.h b/src/TinyGsmClientM590.h index a185e16..a5ae273 100644 --- a/src/TinyGsmClientM590.h +++ b/src/TinyGsmClientM590.h @@ -123,7 +123,7 @@ public: continue; } // TODO: Read directly into user buffer? - if (!rx.size()) { + if (!rx.size() && sock_connected) { at->maintain(); //break; }