try reconnect even on initial no connection established

This commit is contained in:
J0EK3R
2018-01-27 16:21:44 +01:00
parent 9b0bee152f
commit 85f55fc584
+2 -3
View File
@@ -380,9 +380,8 @@ MqttHandler::MqttHandler(UserInfo* userInfo, BusHandler* busHandler, MessageMap*
#else #else
if (mosquitto_connect(m_mosquitto, g_host, g_port, 60, true) != MOSQ_ERR_SUCCESS) { if (mosquitto_connect(m_mosquitto, g_host, g_port, 60, true) != MOSQ_ERR_SUCCESS) {
#endif #endif
logOtherError("mqtt", "unable to connect"); m_connected = false;
mosquitto_destroy(m_mosquitto); logOtherNotice("mqtt", "unable to connect - retry...");
m_mosquitto = NULL;
} else { } else {
m_connected = true; // assume success until connect_callback says otherwise m_connected = true; // assume success until connect_callback says otherwise
logOtherDebug("mqtt", "connection requested"); logOtherDebug("mqtt", "connection requested");