async_mqtt 5.0.0
|
MQTT PUBLISH packet (v3.1.1) More...
#include <v3_1_1_publish.hpp>
Public Member Functions | |
template<typename BufferSequence , typename std::enable_if< is_buffer_sequence< std::decay_t< BufferSequence > >::value, std::nullptr_t >::type = nullptr> | |
basic_publish_packet (packet_id_t packet_id, buffer topic_name, BufferSequence payloads, pub::opts pubopts) | |
constructor | |
template<typename BufferSequence , typename std::enable_if< is_buffer_sequence< std::decay_t< BufferSequence > >::value, std::nullptr_t >::type = nullptr> | |
basic_publish_packet (buffer topic_name, BufferSequence payloads, pub::opts pubopts) | |
constructor for QoS0 This constructor doesn't have packet_id parameter. The packet_id is set to 0 internally and not send actually. | |
std::vector< as::const_buffer > | const_buffer_sequence () const |
Create const buffer sequence it is for boost asio APIs. | |
std::size_t | size () const |
Get packet size. | |
std::size_t | num_of_const_buffer_sequence () const |
Get number of element of const_buffer_sequence. | |
packet_id_t | packet_id () const |
Get packet id. | |
constexpr pub::opts | opts () const |
Get publish_options. | |
constexpr buffer const & | topic () const |
Get topic name. | |
std::vector< buffer > const & | payload () const |
Get payload. | |
auto | payload_range () const |
Get payload range. | |
constexpr void | set_dup (bool dup) |
Set dup flag. | |
Related Symbols | |
(Note that these are not member symbols.) | |
using | publish_packet = basic_publish_packet<2> |
Type alias of basic_publish_packet (PacketIdBytes=2). | |
MQTT PUBLISH packet (v3.1.1)
PacketIdBytes | size of packet_id |
If both the client and the broker keeping the session, QoS1 and QoS2 PUBLISH packet is stored in the endpoint for resending if disconnect/reconnect happens. In addition, the client can sent the packet at offline. The packets are stored and will send after the next connection is established. If the session doesn' exist or lost, then the stored packets are erased.
See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718037
|
inline |
constructor
BufferSequence | Type of the payload |
|
inline |
constructor for QoS0 This constructor doesn't have packet_id parameter. The packet_id is set to 0 internally and not send actually.
BufferSequence | Type of the payload |
topic_name | MQTT TopicName See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349267 |
payloads | The body message of the packet. It could be a single buffer of multiple buffer sequence. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc384800413 |
pubopts | Publish Options. It contains the following elements: DUP See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349262 QoS See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349263 RETAIN See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349265 |
|
inline |
Create const buffer sequence it is for boost asio APIs.
|
inline |
Get number of element of const_buffer_sequence.
|
inlineconstexpr |
Get publish_options.
|
inline |
Get packet id.
|
inline |
Get payload.
|
inline |
Get payload range.
|
inlineconstexpr |
Set dup flag.
dup | flag value to set |
|
inline |
Get packet size.
|
inlineconstexpr |
Get topic name.