Qt MQTT官方demo演示
这里演示simpleclient,如下图所示:
该demo在Qt官网中有介绍:https://doc.qt.io/QtMQTT/qtmqtt-simpleclient-example.html 为了方便演示,官网还提供了两个服务器地址:test.mosquitto.org和broker.hivemq.com,默认端口是1883
To use the application, you first specify a broker, such as test.mosquitto.org or broker.hivemq.com and the port number 1883,
and connect to it. You can then subscribe to a topic and send a message, which you will also receive.
Note: Port number 1883 is not encrypted, and therefore it is suitable only for development and testing purposes.
In production, always use encrypted connections.
simpleclient运行截图如下:
上图log message中是依次点击Connect、Subscribe、Publish和Ping按钮的结果