async_mqtt 9.0.1
|
MQTT CONNECT packet (v3.1.1) More...
#include <v3_1_1_connect.hpp>
Public Member Functions | |
connect_packet (bool clean_session, std::uint16_t keep_alive_sec, std::string client_id, std::optional< std::string > user_name=std::nullopt, std::optional< std::string > password=std::nullopt) | |
constructor | |
connect_packet (bool clean_session, std::uint16_t keep_alive_sec, std::string client_id, std::optional< will > w, std::optional< std::string > user_name=std::nullopt, std::optional< std::string > password=std::nullopt) | |
constructor | |
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. | |
bool | clean_session () const |
Get clean_session. | |
std::uint16_t | keep_alive () const |
Get keep_alive. | |
std::string | client_id () const |
Get client_id. | |
std::optional< std::string > | user_name () const |
Get user_name. | |
std::optional< std::string > | password () const |
Get password. | |
std::optional< will > | get_will () const |
Get will. | |
Static Public Member Functions | |
static constexpr control_packet_type | type () |
Get MQTT control packet type. | |
Related Symbols | |
(Note that these are not member symbols.) | |
bool | operator< (connect_packet const &lhs, connect_packet const &rhs) |
less than operator | |
bool | operator== (connect_packet const &lhs, connect_packet const &rhs) |
equal operator | |
std::ostream & | operator<< (std::ostream &o, connect_packet const &v) |
stream output operator | |
MQTT CONNECT packet (v3.1.1)
Only MQTT client can send this packet.
See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718028
|
explicit |
constructor
clean_session | When the endpoint sends CONNECT packet with clean_session is true, then stored packets are erased. When the endpoint receives CONNECT packet with clean_session is false, then the endpoint start storing PUBLISH packet (QoS1 and QoS2) and PUBREL packet that would send by the endpoint until the corresponding response would be received. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349231 |
keep_alive_sec | When the endpoint sends CONNECT packet with keep_alive_sec, then the endpoint start sending PINGREQ packet keep_alive_sec after the last packet is sent. When the endpoint receives CONNECT packet with keep_alive_sec, then start keep_alive_sec * 1.5 timer. The timer is reset if any packet is received. If the timer is fired, then the endpoint close the underlying layer automatically. At that time, if the endpoint recv() is called, then the CompletionToken is invoked with system_error. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349237 |
client_id | MQTT ClientIdentifier. It is the request to the broker for generating ClientIdentifier if it is empty string and clean_session is true, If false then protocol error. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349242 |
user_name | MQTT UserName. It is often used for authentication. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349245 |
password | MQTT Password. It is often used for authentication. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246 |
|
explicit |
constructor
clean_session | When the endpoint sends CONNECT packet with clean_session is true, then stored packets are erased. When the endpoint receives CONNECT packet with clean_session is false, then the endpoint start storing PUBLISH packet (QoS1 and QoS2) and PUBREL packet that would send by the endpoint until the corresponding response would be received. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349231 |
keep_alive_sec | When the endpoint sends CONNECT packet with keep_alive_sec, then the endpoint start sending PINGREQ packet keep_alive_sec after the last packet is sent. When the endpoint receives CONNECT packet with keep_alive_sec, then start keep_alive_sec * 1.5 timer. The timer is reset if any packet is received. If the timer is fired, then the endpoint close the underlying layer automatically. At that time, if the endpoint recv() is called, then the CompletionToken is invoked with system_error. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349237 |
client_id | MQTT ClientIdentifier. It is the request to the broker for generating ClientIdentifier if it is empty string and clean_session is true, If false then protocol error. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349242 |
w | MQTT Will See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349243 |
user_name | MQTT UserName. It is often used for authentication. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349245 |
password | MQTT Password. It is often used for authentication. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349246 |
bool async_mqtt::v3_1_1::connect_packet::clean_session | ( | ) | const |
Get clean_session.
std::string async_mqtt::v3_1_1::connect_packet::client_id | ( | ) | const |
Get client_id.
std::vector< as::const_buffer > async_mqtt::v3_1_1::connect_packet::const_buffer_sequence | ( | ) | const |
Create const buffer sequence it is for boost asio APIs.
std::optional< will > async_mqtt::v3_1_1::connect_packet::get_will | ( | ) | const |
Get will.
std::uint16_t async_mqtt::v3_1_1::connect_packet::keep_alive | ( | ) | const |
Get keep_alive.
std::size_t async_mqtt::v3_1_1::connect_packet::num_of_const_buffer_sequence | ( | ) | const |
Get number of element of const_buffer_sequence.
std::optional< std::string > async_mqtt::v3_1_1::connect_packet::password | ( | ) | const |
Get password.
std::size_t async_mqtt::v3_1_1::connect_packet::size | ( | ) | const |
Get packet size.
|
inlinestaticconstexpr |
Get MQTT control packet type.
std::optional< std::string > async_mqtt::v3_1_1::connect_packet::user_name | ( | ) | const |
Get user_name.
|
related |
less than operator
lhs | compare target |
rhs | compare target |
|
related |
stream output operator
o | output stream |
v | target |
|
related |
equal operator
lhs | compare target |
rhs | compare target |