Files
mosquitto/test/lib/cpp/02-subscribe-helper-simple-qos2.cpp
2025-12-08 18:51:24 +00:00

29 lines
501 B
C++

#include <cstdlib>
#include <mosquitto/libmosquittopp.h>
#define QOS 2
int main(int argc, char *argv[])
{
int port;
struct mosquitto_message *messages;
if(argc < 2){
return 1;
}
port = atoi(argv[1]);
mosqpp::lib_init();
mosqpp::subscribe_simple(&messages, 1,
true, "qos2/test", QOS, "127.0.0.1", port,
"subscribe-qos2-test", 60, true, NULL, NULL, NULL, NULL);
/* FIXME - this should be in the wrapper */
mosquitto_message_free(&messages);
mosqpp::lib_cleanup();
return 0;
}