Skip to content

Commit c63a6fc

Browse files
luffykesh256dpi
authored andcommitted
last error set on failed socket
_lastError set to LWMQTT_NETWORK_FAILED_CONNECT on socket connect failure.
1 parent 2c4f12c commit c63a6fc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/MQTTClient.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ bool MQTTClient::connect(const char clientId[], const char username[], const cha
273273
int ret = this->netClient->connect(this->hostname, (uint16_t)this->port);
274274
if (ret <= 0) {
275275
return false;
276+
this->_lastError = LWMQTT_NETWORK_FAILED_CONNECT;
276277
}
277278
}
278279

0 commit comments

Comments
 (0)