summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 72b27b2)
raw | patch | inline | side by side (parent: 72b27b2)
author | Florian Forster <octo@collectd.org> | |
Fri, 3 Jul 2015 08:43:38 +0000 (10:43 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 6 Jul 2015 12:07:11 +0000 (14:07 +0200) |
This is the default used by the Mosquitto tools. The new define makes
it possible to easily override this at compile time.
it possible to easily override this at compile time.
src/mqtt.c | patch | blob | history |
diff --git a/src/mqtt.c b/src/mqtt.c
index 7f785dc86b8a89249141ea37a3866e45cd23978f..98b1751db7fafcc9b537aeca7ac2efa95df21465 100644 (file)
--- a/src/mqtt.c
+++ b/src/mqtt.c
#define MQTT_DEFAULT_PORT 1883
#define MQTT_DEFAULT_TOPIC_PREFIX "collectd"
#define MQTT_DEFAULT_TOPIC "collectd/#"
+#ifndef MQTT_KEEPALIVE
+# define MQTT_KEEPALIVE 60
+#endif
+
/*
* Data types
}
status = mosquitto_connect (conf->mosq, conf->host, conf->port,
- /* keepalive = */ 10, /* clean session = */ conf->clean_session);
+ /* keepalive = */ MQTT_KEEPALIVE, /* clean session = */ conf->clean_session);
if (status != MOSQ_ERR_SUCCESS)
{
char errbuf[1024];