Files
boost_mqtt5/doc/qbk/examples/Examples.qbk
T
Korina Šimičević b545d67e26 Add a chapter on asio compliance - per operation cancellation
Summary: related to T12804

Reviewers: ivica

Reviewed By: ivica

Subscribers: miljen, iljazovic

Differential Revision: https://repo.mireo.local/D28516
2024-03-20 10:29:13 +01:00

71 lines
3.2 KiB
Plaintext

[block'''<part>''']
[section:hello_world_over_tcp Hello World over TCP/IP]
This example illustrates the process of setting up the Client to connect to the Broker via TCP/IP and publish a "Hello World!" message.
[import ../../../example/hello_world_over_tcp.cpp]
[hello_world_over_tcp]
[endsect] [/hello_world_over_tcp]
[section:hello_world_over_tls Hello World over TLS/SSL]
This example illustrates the process of setting up the Client to connect to the Broker via TLS/SSL and publish a "Hello World!" message.
[import ../../../example/hello_world_over_tls.cpp]
[hello_world_over_tls]
[endsect] [/hello_world_over_tls]
[section:hello_world_over_websocket_tcp Hello World over Websocket/TCP]
This example illustrates the process of setting up the Client to connect to the Broker via Websocket/TCP and publish a "Hello World!" message.
[import ../../../example/hello_world_over_websocket_tcp.cpp]
[hello_world_over_websocket_tcp]
[endsect] [/hello_world_over_websocket_tcp]
[section:hello_world_over_websocket_tls Hello World over Websocket/TLS]
This example illustrates the process of setting up the Client to connect to the Broker via Websocket/TLS and publish a "Hello World!" message.
[import ../../../example/hello_world_over_websocket_tls.cpp]
[hello_world_over_websocket_tls]
[endsect] [/hello_world_over_websocket_tls]
[section:publisher The publisher]
This example shows how to use __Client__ as a publisher that publishes sensor readings every `5` seconds.
The __Client__ uses TCP to connect to the Broker and modified __USE_AWAITABLE__ as the completion token.
[import ../../../example/publisher.cpp]
[publisher]
[endsect]
[section:receiver The receiver]
This example shows how to use __Client__ as a receiver.
The __Client__ subscribes and indefinitely receives Application Messages from the Broker.
The __Client__ uses TCP to connect to the Broker and modified __USE_AWAITABLE__ as the completion token.
[import ../../../example/receiver.cpp]
[receiver]
[endsect]
[section:multiflight_client The multiflight Client]
This example shows how to use __Client__ to simultaneously dispatch multiple requests.
[import ../../../example/multiflight_client.cpp]
[multiflight_client]
[endsect]
[section:timeout_with_parallel_group Timed MQTT operations with parallel group]
This example demonstrates how to use the __Client__ with its support for per-operation cancellation to perform operations under a time constraint
using parallel group.
Specifically, in this example, the __Client__ will subscribe to a Topic and try to receive a message from the Topic within `5 seconds`.
[import ../../../example/timeout_with_parallel_group.cpp]
[timeout_with_parallel_group]
[endsect]
[section:timeout_with_awaitable_operators Timed MQTT operations with awaitable operators]
This example demonstrates how to use the __Client__ with its support for per-operation cancellation to perform operations under a time constraint
using awaitable operators.
Specifically, in this example, a call to [refmem mqtt_client async_publish] and [refmem mqtt_client async_disconnect] must complete
within `5 seconds`. Otherwise, they will be cancelled.
[import ../../../example/timeout_with_awaitable_operators.cpp]
[timeout_with_awaitable_operators]
[endsect]
[block'''</part>''']