Commit edac5106 authored by Harald Klein's avatar Harald Klein

Merge branch 'mqtt-wip' into 'mqtt-buster'

Merge latest fixes from jstrom mqtt-into raspbian buster

See merge request !39
parents 02203a47 b295d763
Pipeline #461 passed with stage
in 2 minutes and 42 seconds
......@@ -200,8 +200,11 @@ agotransport::MqttImpl::MqttImpl(const std::string &id, const std::string &broke
: mosquittopp(id.c_str())
, connected(false)
, shutdownSignaled(false)
, username(user_)
, password(password_)
, connection_uuid(utils::generateUuid())
, topic_replies_base(std::string(TOPIC_BASE) + connection_uuid + "/replies/"), reply_seq(0) {
, topic_replies_base(std::string(TOPIC_BASE) + connection_uuid + "/replies/")
, reply_seq(0) {
if (!mqtt_inited) {
mosqpp::lib_init();
mqtt_inited = true;
......@@ -252,9 +255,13 @@ bool agotransport::MqttImpl::start() {
break;
} else {
if(rc == MOSQ_ERR_ERRNO && errno == ENOTCONN) {
// Silently ignore, seen on FreeBSD a few times during setup,
// depending on log level (i.e. some other race condition?)
break;
// Seen on FreeBSD a few times during setup:
// depending on log level (i.e. some other race condition?) we sometime get this
// and the connection is not up.
// Retrying seems to work
AGOL_TRACE(transport) << "Connection failed: " << mosquitto_strerror(rc);
usleep(50000);
continue;
}
AGOL_ERROR(transport) << "Connection failed: " << mosquitto_strerror(rc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment