mosquitto/test/lib/cpp/02-subscribe-helper-simple-qos2.cpp

29 lines
501 B
C++
Raw Normal View History

#include <cstdlib>
2023-12-23 13:59:58 +01:00
#include <mosquitto/libmosquittopp.h>
2022-11-30 19:52:38 +01:00
#define QOS 2
2025-09-17 12:19:46 +02:00
2022-11-30 19:52:38 +01:00
int main(int argc, char *argv[])
{
int port;
struct mosquitto_message *messages;
if(argc < 2){
return 1;
}
port = atoi(argv[1]);
mosqpp::lib_init();
2022-11-30 19:52:38 +01:00
mosqpp::subscribe_simple(&messages, 1,
2022-11-30 19:52:38 +01:00
true, "qos2/test", QOS, "localhost", port,
"subscribe-qos2-test", 60, true, NULL, NULL, NULL, NULL);
/* FIXME - this should be in the wrapper */
2022-11-30 19:52:38 +01:00
mosquitto_message_free(&messages);
mosqpp::lib_cleanup();
2022-11-30 19:52:38 +01:00
return 0;
}