![]() |
paho-mqtt-cpp
MQTT C++ Client for POSIX and Windows
|
#include <iasync_client.h>
Public Types | |
using | qos_collection = std::vector< int > |
Friends | |
class | token |
Enables an application to communicate with an MQTT server using non-blocking methods.
It provides applications a simple programming interface to all features of the MQTT version 3.1 specification including:
using mqtt::iasync_client::qos_collection = std::vector<int> |
Type for a collection of QOS values
|
inlinevirtual |
Virtual destructor
|
pure virtual |
Connects to an MQTT server using the default options.
exception | for non security related problems |
security_exception | for security related problems |
Implemented in mqtt::async_client.
|
pure virtual |
Connects to an MQTT server using the provided connect options.
options | a set of connection parameters that override the defaults. |
exception | for non security related problems |
security_exception | for security related problems |
Implemented in mqtt::async_client.
|
pure virtual |
Connects to an MQTT server using the specified options.
options | a set of connection parameters that override the defaults. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | callback listener that will be notified when the connect completes. |
exception | for non security related problems |
security_exception | for security related problems |
Implemented in mqtt::async_client.
|
pure virtual |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | listener that will be notified when the connect completes. |
exception | for non security related problems |
security_exception | for security related problems |
Implemented in mqtt::async_client.
|
pure virtual |
Reconnects the client using options from the previous connect. The client must have previously called connect() for this to work.
Implemented in mqtt::async_client.
|
pure virtual |
Disconnects from the server.
exception | for problems encountered while disconnecting |
Implemented in mqtt::async_client.
|
pure virtual |
Disconnects from the server.
opts | Options for disconnecting. |
exception | for problems encountered while disconnecting |
Implemented in mqtt::async_client.
|
pure virtual |
Disconnects from the server.
timeout | the amount of time in milliseconds to allow for existing work to finish before disconnecting. A value of zero or less means the client will not quiesce. |
exception | for problems encountered while disconnecting |
Implemented in mqtt::async_client.
|
pure virtual |
Disconnects from the server.
timeout | the amount of time in milliseconds to allow for existing work to finish before disconnecting. A value of zero or less means the client will not quiesce. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | listener that will be notified when the disconnect completes. |
exception | for problems encountered while disconnecting |
Implemented in mqtt::async_client.
|
pure virtual |
Disconnects from the server.
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | listener that will be notified when the disconnect completes. |
exception | for problems encountered while disconnecting |
Implemented in mqtt::async_client.
|
pure virtual |
Returns the delivery token for the specified message ID.
Implemented in mqtt::async_client.
|
pure virtual |
Returns the delivery tokens for any outstanding publish operations.
Implemented in mqtt::async_client.
|
pure virtual |
|
pure virtual |
Returns the address of the server used by this client.
Implemented in mqtt::async_client.
|
pure virtual |
Determines if this client is currently connected to the server.
Implemented in mqtt::async_client.
|
pure virtual |
Publishes a message to a topic on the server
topic | The topic to deliver the message to |
payload | the bytes to use as the message payload |
n | the number of bytes in the payload |
qos | the Quality of Service to deliver the message at. Valid values are 0, 1 or 2. |
retained | whether or not this message should be retained by the server. |
Implemented in mqtt::async_client.
|
pure virtual |
Publishes a message to a topic on the server
topic | The topic to deliver the message to |
payload | the bytes to use as the message payload |
n | the number of bytes in the payload |
Implemented in mqtt::async_client.
|
pure virtual |
Publishes a message to a topic on the server
topic | The topic to deliver the message to |
payload | the bytes to use as the message payload |
n | the number of bytes in the payload |
qos | the Quality of Service to deliver the message at. Valid values are 0, 1 or 2. |
retained | whether or not this message should be retained by the server. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb |
Implemented in mqtt::async_client.
|
pure virtual |
Publishes a message to a topic on the server
topic | The topic to deliver the message to |
payload | the bytes to use as the message payload |
qos | the Quality of Service to deliver the message at. Valid values are 0, 1 or 2. |
retained | whether or not this message should be retained by the server. |
Implemented in mqtt::async_client.
|
pure virtual |
Publishes a message to a topic on the server.
topic | The topic to deliver the message to |
payload | the bytes to use as the message payload |
Implemented in mqtt::async_client.
|
pure virtual |
Publishes a message to a topic on the server Takes an Message message and delivers it to the server at the requested quality of service.
msg | the message to deliver to the server |
Implemented in mqtt::async_client.
|
pure virtual |
Publishes a message to a topic on the server.
msg | the message to deliver to the server |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | optional listener that will be notified when message delivery has completed to the requested quality of service |
Implemented in mqtt::async_client.
|
pure virtual |
Sets a callback listener to use for events that happen asynchronously.
cb | callback which will be invoked for certain asynchronous events |
Implemented in mqtt::async_client.
|
pure virtual |
Stops the callbacks.
Implemented in mqtt::async_client.
|
pure virtual |
Subscribe to a topic, which may include wildcards.
topicFilter | the topic to subscribe to, which can include wildcards. |
qos | the maximum quality of service at which to subscribe. Messages published at a lower quality of service will be received at the published QoS. Messages published at a higher quality of service will be received using the QoS specified on the subscribe. |
opts | The options for the subscription. |
props | The MQTT v5 properties. |
Implemented in mqtt::async_client.
|
pure virtual |
Subscribe to a topic, which may include wildcards.
topicFilter | the topic to subscribe to, which can include wildcards. |
qos | the maximum quality of service at which to subscribe. Messages published at a lower quality of service will be received at the published QoS. Messages published at a higher quality of service will be received using the QoS specified on the subscribe. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
callback | listener that will be notified when subscribe has completed |
opts | The options for the subscription. |
props | The MQTT v5 properties. |
Implemented in mqtt::async_client.
|
pure virtual |
Subscribe to multiple topics, each of which may include wildcards. Provides an optimized way to subscribe to multiple topics compared to subscribing to each one individually.
topicFilters | one or more topics to subscribe to, which can include wildcards |
qos | the maximum quality of service at which to subscribe. Messages published at a lower quality of service will be received at the published QoS. Messages published at a higher quality of service will be received using the QoS specified on the subscribe. |
opts | A collection of subscription options (one for each topic) |
props | The MQTT v5 properties. |
Implemented in mqtt::async_client.
|
pure virtual |
Subscribes to multiple topics, each of which may include wildcards.
topicFilters | one or more topics to subscribe to, which can include wildcards |
qos | the maximum quality of service at which to subscribe. Messages published at a lower quality of service will be received at the published QoS. Messages published at a higher quality of service will be received using the QoS specified on the subscribe. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
callback | listener that will be notified when subscribe has completed |
opts | A collection of subscription options (one for each topic) |
props | The MQTT v5 properties. |
Implemented in mqtt::async_client.
|
pure virtual |
Requests the server unsubscribe the client from a topic.
topicFilter | the topic to unsubscribe from. It must match a topicFilter specified on an earlier subscribe. |
props | The MQTT v5 properties. |
Implemented in mqtt::async_client.
|
pure virtual |
Requests the server unsubscribe the client from one or more topics.
topicFilters | one or more topics to unsubscribe from. Each topicFilter must match one specified on an earlier subscribe. |
props | The MQTT v5 properties. |
Implemented in mqtt::async_client.
|
pure virtual |
Requests the server unsubscribe the client from one or more topics.
topicFilters | one or more topics to unsubscribe from. Each topicFilter must match one specified on an earlier subscribe. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | listener that will be notified when unsubscribe has completed |
props | The MQTT v5 properties. |
Implemented in mqtt::async_client.
|
pure virtual |
Requests the server unsubscribe the client from a topics.
topicFilter | the topic to unsubscribe from. It must match a topicFilter specified on an earlier subscribe. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | listener that will be notified when unsubscribe has completed. |
props | The MQTT v5 properties. |
Implemented in mqtt::async_client.
|
pure virtual |
Start consuming messages. This initializes the client to receive messages through a queue that can be read synchronously.
Implemented in mqtt::async_client.
|
pure virtual |
Stop consuming messages. This shuts down the internal callback and discards any unread messages.
Implemented in mqtt::async_client.
|
pure virtual |
Read the next message from the queue. This blocks until a new message arrives.
Implemented in mqtt::async_client.
|
pure virtual |
Try to read the next message from the queue without blocking.
msg | Pointer to the value to receive the message |
Implemented in mqtt::async_client.
|
friend |