From 830f34c7d02b3db1df4212a898e1e77e1766db44 Mon Sep 17 00:00:00 2001 From: Sergey Konyukhovskiy Date: Fri, 4 Dec 2015 04:10:18 +0300 Subject: [PATCH] correct handling of dns fauilure In case of domain name resolution error result can be negative (see Dns.cpp:46) --- src/PubSubClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PubSubClient.cpp b/src/PubSubClient.cpp index 5c023390..6682ea56 100755 --- a/src/PubSubClient.cpp +++ b/src/PubSubClient.cpp @@ -122,7 +122,7 @@ boolean PubSubClient::connect(const char *id, const char *user, const char *pass } else { result = _client->connect(this->ip, this->port); } - if (result) { + if (result == 1) { nextMsgId = 1; // Leave room in the buffer for header and variable length field uint16_t length = 5;