mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-11-02 08:51:46 +01:00
async_run
Reviewers: ivica Reviewed By: ivica Subscribers: korina Differential Revision: https://repo.mireo.local/D27342
This commit is contained in:
@@ -19,9 +19,9 @@ asio::awaitable<void> client_publisher(asio::io_context& ioc) {
|
||||
async_mqtt5::mqtt_client<asio::ip::tcp::socket> client(ioc, "");
|
||||
|
||||
// Configure the ``__Client__``.
|
||||
// It is mandatory to call brokers() and run() to configure the Brokers to connect to and start the Client.
|
||||
// It is mandatory to call brokers() and async_run() to configure the Brokers to connect to and start the Client.
|
||||
client.brokers("mqtt.broker", 1883) // Broker that we want to connect to. 1883 is the default TCP port.
|
||||
.run(); // Start the client.
|
||||
.async_run(asio::detached); // Start the client.
|
||||
|
||||
// Publish an Application Message with QoS 1.
|
||||
auto [rc, props] = co_await client.async_publish<async_mqtt5::qos_e::at_least_once>(
|
||||
|
||||
Reference in New Issue
Block a user