Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes issues #1006 and #1008.
On Linux the MQTT plugin freezes PlotJugger see issue #1008. The program flow seems to be stuck within mosquitto_connect_bind_v5() on the second connection attempt. This is solved by starting with a fresh mosquitto instance at each connection attempt.
On Windows PlotJuggler doesn't show any topics after establishing a connection, see issue #1006. mqtt_client.cpp does not check the return code of mosquitto_loop_start(), which may return MOSQ_ERR_NOT_SUPPORTED on Windows. This causes the plugin to assume that the connection has been established, but in reality the mosquitto event loop is not processed. This causes the user to think that a connection was established but no topics are displayed. The plugin worked in the past with no recent changes to the source code, so what causes the problem? It seems that libmosquitto has at some point dropped threaded support on Windows (see eclipse-mosquitto/mosquitto#2707). Threaded support will be added again in the future (maybe 2.1?). To solve this problem mosquitto gets it's own thread if mosquitto_loop_start() fails.
To make mqtt_client.cpp more robust all mosquitto_xxx return codes are checked. To increase the user experience some QMessageBox messages have been added.
fixes #1006
fixes #1008
Kind regards,
Valentin