Commit 5c2c9a4b authored by Michael Ott's avatar Michael Ott
Browse files

Fixing opening of MQTT connections again after the fix has been reverted...

Fixing opening of MQTT connections again after the fix has been reverted during the latest merge. See 8b9bbaf7
parent 4fcad3da
......@@ -268,6 +268,11 @@ int main(int argc, char** argv) {
LOG(info) << " Certificate, private key and DH-param file not printed.";
#endif
//MQTTPusher and Https server get their own threads
_mqttPusher = new MQTTPusher(globalSettings.brokerPort, globalSettings.brokerHost, pluginSettings.sensorPattern, globalSettings.qosLevel, _configuration->getPlugins(), globalSettings.maxMsgNum);
_httpsServer = new HttpsServer(restAPISettings, _configuration->getPlugins(), _mqttPusher, io);
_configuration->readAuthkeys(_httpsServer);
//Init all sensors
LOG(info) << "Init sensors...";
for(auto& p : _configuration->getPlugins()) {
......@@ -314,11 +319,6 @@ int main(int argc, char** argv) {
threads.create_thread(bind(static_cast< size_t (boost::asio::io_service::*) () >(&boost::asio::io_service::run), &io));
}
//MQTTPusher and Https server get their own threads
_mqttPusher = new MQTTPusher(globalSettings.brokerPort, globalSettings.brokerHost, pluginSettings.sensorPattern, globalSettings.qosLevel, _configuration->getPlugins(), globalSettings.maxMsgNum);
_httpsServer = new HttpsServer(restAPISettings, _configuration->getPlugins(), _mqttPusher, io);
_configuration->readAuthkeys(_httpsServer);
boost::thread mqttThread(bind(&MQTTPusher::push, _mqttPusher));
boost::thread restThread(bind(&HttpsServer::run, _httpsServer));
......
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