mqtt_cpp
|
#include <callable_overlay.hpp>
Public Types | |
using | base = Impl |
using | packet_id_t = typename base::packet_id_t |
using | pingreq_handler = std::function< bool()> |
Pingreq handler See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718086 3.13 PINGREQ – PING request. More... | |
using | pingresp_handler = std::function< bool()> |
Pingresp handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200 3.13 PINGRESP – PING response. More... | |
using | connect_handler = std::function< bool(buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > will, bool clean_session, std::uint16_t keep_alive)> |
Connect handler. More... | |
using | connack_handler = std::function< bool(bool session_present, connect_return_code return_code)> |
Connack handler. More... | |
using | publish_handler = std::function< bool(optional< packet_id_t > packet_id, publish_options pubopts, buffer topic_name, buffer contents)> |
Publish handler. More... | |
using | puback_handler = std::function< bool(packet_id_t packet_id)> |
Puback handler. More... | |
using | pubrec_handler = std::function< bool(packet_id_t packet_id)> |
Pubrec handler. More... | |
using | pubrel_handler = std::function< bool(packet_id_t packet_id)> |
Pubrel handler. More... | |
using | pubcomp_handler = std::function< bool(packet_id_t packet_id)> |
Pubcomp handler. More... | |
using | subscribe_handler = std::function< bool(packet_id_t packet_id, std::vector< subscribe_entry > entries)> |
Subscribe handler. More... | |
using | suback_handler = std::function< bool(packet_id_t packet_id, std::vector< suback_return_code > qoss)> |
Suback handler. More... | |
using | unsubscribe_handler = std::function< bool(packet_id_t packet_id, std::vector< unsubscribe_entry > entries)> |
Unsubscribe handler. More... | |
using | unsuback_handler = std::function< bool(packet_id_t)> |
Unsuback handler. More... | |
using | disconnect_handler = std::function< void()> |
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc384800463 3.14 DISCONNECT – Disconnect notification. More... | |
using | v5_connect_handler = std::function< bool(buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > will, bool clean_start, std::uint16_t keep_alive, v5::properties props) > |
Connect handler. More... | |
using | v5_connack_handler = std::function< bool(bool session_present, v5::connect_reason_code reason_code, v5::properties props) > |
Connack handler. More... | |
using | v5_publish_handler = std::function< bool(optional< packet_id_t > packet_id, publish_options pubopts, buffer topic_name, buffer contents, v5::properties props) > |
Publish handler. More... | |
using | v5_puback_handler = std::function< bool(packet_id_t packet_id, v5::puback_reason_code reason_code, v5::properties props) > |
Puback handler. More... | |
using | v5_pubrec_handler = std::function< bool(packet_id_t packet_id, v5::pubrec_reason_code reason_code, v5::properties props) > |
Pubrec handler. More... | |
using | v5_pubrel_handler = std::function< bool(packet_id_t packet_id, v5::pubrel_reason_code reason_code, v5::properties props) > |
Pubrel handler. More... | |
using | v5_pubcomp_handler = std::function< bool(packet_id_t packet_id, v5::pubcomp_reason_code reason_code, v5::properties props) > |
Pubcomp handler. More... | |
using | v5_subscribe_handler = std::function< bool(packet_id_t packet_id, std::vector< subscribe_entry > entries, v5::properties props) > |
Subscribe handler. More... | |
using | v5_suback_handler = std::function< bool(packet_id_t packet_id, std::vector< v5::suback_reason_code > reasons, v5::properties props) > |
Suback handler. More... | |
using | v5_unsubscribe_handler = std::function< bool(packet_id_t packet_id, std::vector< unsubscribe_entry > entries, v5::properties props) > |
Unsubscribe handler. More... | |
using | v5_unsuback_handler = std::function< bool(packet_id_t, std::vector< v5::unsuback_reason_code > reasons, v5::properties props) > |
Unsuback handler. More... | |
using | v5_disconnect_handler = std::function< void(v5::disconnect_reason_code reason_code, v5::properties props) > |
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901205 3.14 DISCONNECT – Disconnect notification. More... | |
using | v5_auth_handler = std::function< bool(v5::auth_reason_code reason_code, v5::properties props) > |
Auth handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901217 3.15 AUTH – Authentication exchange. More... | |
using | close_handler = std::function< void()> |
Close handler. More... | |
using | error_handler = std::function< void(error_code ec)> |
Error handler. More... | |
using | pub_res_sent_handler = std::function< void(packet_id_t packet_id)> |
Publish response sent handler This function is called just after puback sent on QoS1, or pubcomp sent on QoS2. More... | |
using | serialize_publish_message_handler = std::function< void(basic_publish_message< sizeof(packet_id_t)> msg)> |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message(). More... | |
using | serialize_v5_publish_message_handler = std::function< void(v5::basic_publish_message< sizeof(packet_id_t)> msg)> |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message(). More... | |
using | serialize_publish_handler = std::function< void(packet_id_t packet_id, char const *data, std::size_t size)> |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message(). More... | |
using | serialize_pubrel_message_handler = std::function< void(basic_pubrel_message< sizeof(packet_id_t)> msg)> |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message(). More... | |
using | serialize_v5_pubrel_message_handler = std::function< void(v5::basic_pubrel_message< sizeof(packet_id_t)> msg)> |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message(). More... | |
using | serialize_pubrel_handler = std::function< void(packet_id_t packet_id, char const *data, std::size_t size)> |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message(). More... | |
using | serialize_remove_handler = std::function< void(packet_id_t packet_id)> |
Remove serialized message. More... | |
using | pre_send_handler = std::function< void()> |
Pre-send handler This handler is called when any mqtt control packet is decided to send. More... | |
using | is_valid_length_handler = std::function< bool(control_packet_type packet_type, std::size_t remaining_length)> |
is valid length handler This handler is called when remaining length is received. More... | |
using | mqtt_message_processed_handler = std::function< void(any session_life_keeper)> |
next read handler This handler is called when the current mqtt message has been processed. More... | |
Public Member Functions | |
template<typename ... Args> | |
callable_overlay (Args &&... args) | |
~callable_overlay ()=default | |
callable_overlay (callable_overlay &&)=default | |
callable_overlay (callable_overlay const &)=default | |
callable_overlay & | operator= (callable_overlay &&)=default |
callable_overlay & | operator= (callable_overlay const &)=default |
MQTT_ALWAYS_INLINE bool | on_pingreq () noexcept override final |
Pingreq handler See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718086 3.13 PINGREQ – PING request. More... | |
MQTT_ALWAYS_INLINE bool | on_pingresp () noexcept override final |
Pingresp handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200 3.13 PINGRESP – PING response. More... | |
MQTT_ALWAYS_INLINE bool | on_connect (buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > will, bool clean_session, std::uint16_t keep_alive) noexcept override final |
Connect handler. More... | |
MQTT_ALWAYS_INLINE bool | on_connack (bool session_present, connect_return_code return_code) noexcept override final |
Connack handler. More... | |
MQTT_ALWAYS_INLINE bool | on_publish (optional< packet_id_t > packet_id, publish_options pubopts, buffer topic_name, buffer contents) noexcept override final |
Publish handler. More... | |
MQTT_ALWAYS_INLINE bool | on_puback (packet_id_t packet_id) noexcept override final |
Puback handler. More... | |
MQTT_ALWAYS_INLINE bool | on_pubrec (packet_id_t packet_id) noexcept override final |
Pubrec handler. More... | |
MQTT_ALWAYS_INLINE bool | on_pubrel (packet_id_t packet_id) noexcept override final |
Pubrel handler. More... | |
MQTT_ALWAYS_INLINE bool | on_pubcomp (packet_id_t packet_id) noexcept override final |
Pubcomp handler. More... | |
MQTT_ALWAYS_INLINE bool | on_subscribe (packet_id_t packet_id, std::vector< subscribe_entry > entries) noexcept override final |
Subscribe handler. More... | |
MQTT_ALWAYS_INLINE bool | on_suback (packet_id_t packet_id, std::vector< suback_return_code > reasons) noexcept override final |
Suback handler. More... | |
MQTT_ALWAYS_INLINE bool | on_unsubscribe (packet_id_t packet_id, std::vector< unsubscribe_entry > entries) noexcept override final |
Unsubscribe handler. More... | |
MQTT_ALWAYS_INLINE bool | on_unsuback (packet_id_t packet_id) noexcept override final |
Unsuback handler. More... | |
MQTT_ALWAYS_INLINE void | on_disconnect () noexcept override final |
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc384800463 3.14 DISCONNECT – Disconnect notification. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_connect (buffer client_id, optional< buffer > user_name, optional< buffer > password, optional< will > will, bool clean_start, std::uint16_t keep_alive, v5::properties props) noexcept override final |
Connect handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_connack (bool session_present, v5::connect_reason_code reason_code, v5::properties props) noexcept override final |
Connack handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_publish (optional< packet_id_t > packet_id, publish_options pubopts, buffer topic_name, buffer contents, v5::properties props) noexcept override final |
Publish handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_puback (packet_id_t packet_id, v5::puback_reason_code reason_code, v5::properties props) noexcept override final |
Puback handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_pubrec (packet_id_t packet_id, v5::pubrec_reason_code reason_code, v5::properties props) noexcept override final |
Pubrec handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_pubrel (packet_id_t packet_id, v5::pubrel_reason_code reason_code, v5::properties props) noexcept override final |
Pubrel handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_pubcomp (packet_id_t packet_id, v5::pubcomp_reason_code reason_code, v5::properties props) noexcept override final |
Pubcomp handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_subscribe (packet_id_t packet_id, std::vector< subscribe_entry > entries, v5::properties props) noexcept override final |
Subscribe handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_suback (packet_id_t packet_id, std::vector< v5::suback_reason_code > reasons, v5::properties props) noexcept override final |
Suback handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_unsubscribe (packet_id_t packet_id, std::vector< unsubscribe_entry > entries, v5::properties props) noexcept override final |
Unsubscribe handler. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_unsuback (packet_id_t packet_id, std::vector< v5::unsuback_reason_code > reasons, v5::properties props) noexcept override final |
Unsuback handler. More... | |
MQTT_ALWAYS_INLINE void | on_v5_disconnect (v5::disconnect_reason_code reason_code, v5::properties props) noexcept override final |
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901205 3.14 DISCONNECT – Disconnect notification. More... | |
MQTT_ALWAYS_INLINE bool | on_v5_auth (v5::auth_reason_code reason_code, v5::properties props) noexcept override final |
Auth handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901217 3.15 AUTH – Authentication exchange. More... | |
MQTT_ALWAYS_INLINE void | on_close () noexcept override final |
Close handler. More... | |
MQTT_ALWAYS_INLINE void | on_error (error_code ec) noexcept override final |
Error handler. More... | |
MQTT_ALWAYS_INLINE void | on_pub_res_sent (packet_id_t packet_id) noexcept override final |
Publish response sent handler This function is called just after puback sent on QoS1, or pubcomp sent on QoS2. More... | |
MQTT_ALWAYS_INLINE void | on_serialize_publish_message (basic_publish_message< sizeof(packet_id_t)> msg) noexcept override final |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message(). More... | |
MQTT_ALWAYS_INLINE void | on_serialize_v5_publish_message (v5::basic_publish_message< sizeof(packet_id_t)> msg) noexcept override final |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message(). More... | |
MQTT_ALWAYS_INLINE void | on_serialize_pubrel_message (basic_pubrel_message< sizeof(packet_id_t)> msg) noexcept override final |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message(). More... | |
MQTT_ALWAYS_INLINE void | on_serialize_v5_pubrel_message (v5::basic_pubrel_message< sizeof(packet_id_t)> msg) noexcept override final |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message(). More... | |
MQTT_ALWAYS_INLINE void | on_serialize_remove (packet_id_t packet_id) noexcept override final |
Remove serialized message. More... | |
MQTT_ALWAYS_INLINE void | on_pre_send () noexcept override final |
Pre-send handler This handler is called when any mqtt control packet is decided to send. More... | |
MQTT_ALWAYS_INLINE bool | check_is_valid_length (control_packet_type packet_type, std::size_t remaining_length) noexcept override final |
is valid length handler This handler is called when remaining length is received. More... | |
MQTT_ALWAYS_INLINE void | on_mqtt_message_processed (any session_life_keeper) noexcept override final |
next read handler This handler is called when the current mqtt message has been processed. This calls base::on_mqtt_message_processed() only if mqtt_message_processed handler is not set. More... | |
void | set_pingreq_handler (pingreq_handler h=pingreq_handler()) |
Set pingreq handler. More... | |
void | set_pingresp_handler (pingresp_handler h=pingresp_handler()) |
Set pingresp handler. More... | |
pingreq_handler const & | get_pingreq_handler () const |
Get pingreq handler. More... | |
pingresp_handler const & | get_pingresp_handler () const |
Get pingresp handler. More... | |
void | set_connect_handler (connect_handler h=connect_handler()) |
Set connect handler. More... | |
void | set_connack_handler (connack_handler h=connack_handler()) |
Set connack handler. More... | |
void | set_publish_handler (publish_handler h=publish_handler()) |
Set publish handler. More... | |
void | set_puback_handler (puback_handler h=puback_handler()) |
Set puback handler. More... | |
void | set_pubrec_handler (pubrec_handler h=pubrec_handler()) |
Set pubrec handler. More... | |
void | set_pubrel_handler (pubrel_handler h=pubrel_handler()) |
Set pubrel handler. More... | |
void | set_pubcomp_handler (pubcomp_handler h=pubcomp_handler()) |
Set pubcomp handler. More... | |
void | set_subscribe_handler (subscribe_handler h=subscribe_handler()) |
Set subscribe handler. More... | |
void | set_suback_handler (suback_handler h=suback_handler()) |
Set suback handler. More... | |
void | set_unsubscribe_handler (unsubscribe_handler h=unsubscribe_handler()) |
Set unsubscribe handler. More... | |
void | set_unsuback_handler (unsuback_handler h=unsuback_handler()) |
Set unsuback handler. More... | |
void | set_disconnect_handler (disconnect_handler h=disconnect_handler()) |
Set disconnect handler. More... | |
connect_handler const & | get_connect_handler () const |
Get connect handler. More... | |
connack_handler const & | get_connack_handler () const |
Get connack handler. More... | |
publish_handler const & | get_publish_handler () const |
Set publish handler. More... | |
puback_handler const & | get_puback_handler () const |
Get puback handler. More... | |
pubrec_handler const & | get_pubrec_handler () const |
Get pubrec handler. More... | |
pubrel_handler const & | get_pubrel_handler () const |
Get pubrel handler. More... | |
pubcomp_handler const & | get_pubcomp_handler () const |
Get pubcomp handler. More... | |
subscribe_handler const & | get_subscribe_handler () const |
Get subscribe handler. More... | |
suback_handler const & | get_suback_handler () const |
Get suback handler. More... | |
unsubscribe_handler const & | get_unsubscribe_handler () const |
Get unsubscribe handler. More... | |
unsuback_handler const & | get_unsuback_handler () const |
Get unsuback handler. More... | |
disconnect_handler const & | get_disconnect_handler () const |
Get disconnect handler. More... | |
void | set_v5_connect_handler (v5_connect_handler h=v5_connect_handler()) |
Set connect handler. More... | |
void | set_v5_connack_handler (v5_connack_handler h=v5_connack_handler()) |
Set connack handler. More... | |
void | set_v5_publish_handler (v5_publish_handler h=v5_publish_handler()) |
Set publish handler. More... | |
void | set_v5_puback_handler (v5_puback_handler h=v5_puback_handler()) |
Set puback handler. More... | |
void | set_v5_pubrec_handler (v5_pubrec_handler h=v5_pubrec_handler()) |
Set pubrec handler. More... | |
void | set_v5_pubrel_handler (v5_pubrel_handler h=v5_pubrel_handler()) |
Set pubrel handler. More... | |
void | set_v5_pubcomp_handler (v5_pubcomp_handler h=v5_pubcomp_handler()) |
Set pubcomp handler. More... | |
void | set_v5_subscribe_handler (v5_subscribe_handler h=v5_subscribe_handler()) |
Set subscribe handler. More... | |
void | set_v5_suback_handler (v5_suback_handler h=v5_suback_handler()) |
Set suback handler. More... | |
void | set_v5_unsubscribe_handler (v5_unsubscribe_handler h=v5_unsubscribe_handler()) |
Set unsubscribe handler. More... | |
void | set_v5_unsuback_handler (v5_unsuback_handler h=v5_unsuback_handler()) |
Set unsuback handler. More... | |
void | set_v5_disconnect_handler (v5_disconnect_handler h=v5_disconnect_handler()) |
Set disconnect handler. More... | |
void | set_v5_auth_handler (v5_auth_handler h=v5_auth_handler()) |
Set auth handler. More... | |
v5_connect_handler const & | get_v5_connect_handler () const |
Get connect handler. More... | |
v5_connack_handler const & | get_v5_connack_handler () const |
Get connack handler. More... | |
v5_publish_handler const & | get_v5_publish_handler () const |
Set publish handler. More... | |
v5_puback_handler const & | get_v5_puback_handler () const |
Get puback handler. More... | |
v5_pubrec_handler const & | get_v5__handler () const |
Get pubrec handler. More... | |
v5_pubrel_handler const & | get_v5_pubrel_handler () const |
Get pubrel handler. More... | |
v5_pubcomp_handler const & | get_v5_pubcomp_handler () const |
Get pubcomp handler. More... | |
v5_subscribe_handler const & | get_v5_subscribe_handler () const |
Get subscribe handler. More... | |
v5_suback_handler const & | get_v5_suback_handler () const |
Get suback handler. More... | |
v5_unsubscribe_handler const & | get_v5_unsubscribe_handler () const |
Get unsubscribe handler. More... | |
v5_unsuback_handler const & | get_v5_unsuback_handler () const |
Get unsuback handler. More... | |
v5_disconnect_handler const & | get_v5_disconnect_handler () const |
Get disconnect handler. More... | |
v5_auth_handler const & | get_v5_auth_handler () const |
Get auth handler. More... | |
void | set_pub_res_sent_handler (pub_res_sent_handler h=pub_res_sent_handler()) |
Set pubcomp handler. More... | |
void | set_serialize_handlers (serialize_publish_message_handler h_publish, serialize_pubrel_message_handler h_pubrel, serialize_remove_handler h_remove) |
Set serialize handlers. More... | |
void | set_v5_serialize_handlers (serialize_v5_publish_message_handler h_publish, serialize_v5_pubrel_message_handler h_pubrel, serialize_remove_handler h_remove) |
Set serialize handlers. More... | |
void | set_serialize_handlers (serialize_publish_handler h_publish, serialize_pubrel_handler h_pubrel, serialize_remove_handler h_remove) |
Set serialize handlers. More... | |
void | set_v5_serialize_handlers (serialize_publish_handler h_publish, serialize_pubrel_handler h_pubrel, serialize_remove_handler h_remove) |
Set serialize handlers. More... | |
void | set_serialize_handlers () |
Clear serialize handlers. More... | |
void | set_pre_send_handler (pre_send_handler h=pre_send_handler()) |
Set pre-send handler. More... | |
void | set_is_valid_length_handler (is_valid_length_handler h=is_valid_length_handler()) |
Set check length handler. More... | |
pub_res_sent_handler const & | get_pub_res_sent_handler () const |
Get publish response sent handler. More... | |
serialize_publish_message_handler const & | get_serialize_publish_message_handler () const |
Get serialize publish handler. More... | |
serialize_pubrel_message_handler const & | get_serialize_pubrel_message_handler () const |
Get serialize pubrel handler. More... | |
serialize_v5_publish_message_handler const & | get_serialize_v5_publish_message_handler () const |
Get serialize publish handler. More... | |
serialize_v5_pubrel_message_handler const & | get_serialize_v5_pubrel_message_handler () const |
Get serialize pubrel handler. More... | |
serialize_remove_handler const & | get_serialize_remove_handler () const |
Get serialize remove handler. More... | |
pre_send_handler const & | get_pre_send_handler () const |
Get pre-send handler. More... | |
is_valid_length_handler const & | get_is_valid_length_handler () const |
Get check length handler. More... | |
void | set_mqtt_message_processed_handler (mqtt_message_processed_handler h=mqtt_message_processed_handler()) |
Set custom mqtt_message_processed_handler. The default setting is calling async_read_control_packet_type(). (See endpoint() constructor). The typical usecase of this function is delaying the next message reading timing. In order to do that 1) store func parameter of the mqtt_message_processed_handler. 2) call async_read_next_message with the stored func if you are ready to read the next mqtt message. More... | |
mqtt_message_processed_handler | get_mqtt_message_processed_handler () const |
Get mqtt_message_processed_handler. More... | |
void | set_close_handler (close_handler h=close_handler()) |
Set close handler. More... | |
void | set_error_handler (error_handler h=error_handler()) |
Set error handler. More... | |
close_handler | get_close_handler () const |
Get close handler. More... | |
error_handler | get_error_handler () const |
Get error handler. More... | |
using MQTT_NS::callable_overlay< Impl >::base = Impl |
using MQTT_NS::callable_overlay< Impl >::close_handler = std::function<void()> |
Close handler.
This handler is called if the client called disconnect()
and the server closed the socket cleanly. If the socket is closed by other reasons, error_handler is called.
using MQTT_NS::callable_overlay< Impl >::connack_handler = std::function<bool(bool session_present, connect_return_code return_code)> |
Connack handler.
session_present | Session present flag. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718036 3.2.2.2 Session Present |
return_code | connect_return_code See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718036 3.2.2.3 Connect Return code |
using MQTT_NS::callable_overlay< Impl >::connect_handler = std::function< bool(buffer client_id, optional<buffer> user_name, optional<buffer> password, optional<will> will, bool clean_session, std::uint16_t keep_alive)> |
Connect handler.
using MQTT_NS::callable_overlay< Impl >::disconnect_handler = std::function<void()> |
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc384800463
3.14 DISCONNECT – Disconnect notification.
using MQTT_NS::callable_overlay< Impl >::error_handler = std::function<void(error_code ec)> |
Error handler.
This handler is called if the socket is closed without client's disconnect()
call.
ec | error code |
using MQTT_NS::callable_overlay< Impl >::is_valid_length_handler = std::function<bool(control_packet_type packet_type, std::size_t remaining_length)> |
is valid length handler This handler is called when remaining length is received.
control_packet_type | control_packet_type that has variable length |
remaining | length |
using MQTT_NS::callable_overlay< Impl >::mqtt_message_processed_handler = std::function<void(any session_life_keeper)> |
next read handler This handler is called when the current mqtt message has been processed.
func | A callback function that is called when async operation will finish. |
using MQTT_NS::callable_overlay< Impl >::packet_id_t = typename base::packet_id_t |
using MQTT_NS::callable_overlay< Impl >::pingreq_handler = std::function<bool()> |
Pingreq handler See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718086
3.13 PINGREQ – PING request.
using MQTT_NS::callable_overlay< Impl >::pingresp_handler = std::function<bool()> |
Pingresp handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200
3.13 PINGRESP – PING response.
using MQTT_NS::callable_overlay< Impl >::pre_send_handler = std::function<void()> |
Pre-send handler This handler is called when any mqtt control packet is decided to send.
using MQTT_NS::callable_overlay< Impl >::pub_res_sent_handler = std::function<void(packet_id_t packet_id)> |
Publish response sent handler This function is called just after puback sent on QoS1, or pubcomp sent on QoS2.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901026 2.2.1 Packet Identifier |
using MQTT_NS::callable_overlay< Impl >::puback_handler = std::function<bool(packet_id_t packet_id)> |
Puback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718045 3.4.2 Variable header |
using MQTT_NS::callable_overlay< Impl >::pubcomp_handler = std::function<bool(packet_id_t packet_id)> |
Pubcomp handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718060 3.7.2 Variable header |
using MQTT_NS::callable_overlay< Impl >::publish_handler = std::function<bool(optional<packet_id_t> packet_id, publish_options pubopts, buffer topic_name, buffer contents)> |
Publish handler.
fixed_header | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718038 3.3.1 Fixed header You can check the fixed header using publish functions. |
packet_id | packet identifier If received publish's QoS is 0, packet_id is nullopt. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718039 3.3.2 Variable header |
topic_name | Topic name |
contents | Published contents |
using MQTT_NS::callable_overlay< Impl >::pubrec_handler = std::function<bool(packet_id_t packet_id)> |
Pubrec handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718050 3.5.2 Variable header |
using MQTT_NS::callable_overlay< Impl >::pubrel_handler = std::function<bool(packet_id_t packet_id)> |
Pubrel handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349791 3.6.2 Variable header |
using MQTT_NS::callable_overlay< Impl >::serialize_publish_handler = std::function<void(packet_id_t packet_id, char const* data, std::size_t size)> |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message().
packet_id | packet identifier of the serializing message |
data | pointer to the serializing message |
size | size of the serializing message |
using MQTT_NS::callable_overlay< Impl >::serialize_publish_message_handler = std::function<void(basic_publish_message<sizeof(packet_id_t)> msg)> |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message().
msg | publish message |
using MQTT_NS::callable_overlay< Impl >::serialize_pubrel_handler = std::function<void(packet_id_t packet_id, char const* data, std::size_t size)> |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message().
packet_id | packet identifier of the serializing message |
data | pointer to the serializing message |
size | size of the serializing message |
using MQTT_NS::callable_overlay< Impl >::serialize_pubrel_message_handler = std::function<void(basic_pubrel_message<sizeof(packet_id_t)> msg)> |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message().
msg | pubrel message |
using MQTT_NS::callable_overlay< Impl >::serialize_remove_handler = std::function<void(packet_id_t packet_id)> |
Remove serialized message.
packet_id | packet identifier of the removing message |
using MQTT_NS::callable_overlay< Impl >::serialize_v5_publish_message_handler = std::function<void(v5::basic_publish_message<sizeof(packet_id_t)> msg)> |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message().
msg | v5::publish message |
using MQTT_NS::callable_overlay< Impl >::serialize_v5_pubrel_message_handler = std::function<void(v5::basic_pubrel_message<sizeof(packet_id_t)> msg)> |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message().
msg | pubrel message |
using MQTT_NS::callable_overlay< Impl >::suback_handler = std::function<bool(packet_id_t packet_id, std::vector<suback_return_code> qoss)> |
Suback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718070 3.9.2 Variable header |
qoss | Collection of QoS that is corresponding to subscribed topic order. If subscription is failure, the value is nullopt. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718071 |
using MQTT_NS::callable_overlay< Impl >::subscribe_handler = std::function<bool(packet_id_t packet_id, std::vector<subscribe_entry> entries)> |
Subscribe handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349801 3.8.2 Variable header |
entries | Collection of Share Name, Topic Filter, and QoS. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349802 |
using MQTT_NS::callable_overlay< Impl >::unsuback_handler = std::function<bool(packet_id_t)> |
Unsuback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718045 3.11.2 Variable header |
using MQTT_NS::callable_overlay< Impl >::unsubscribe_handler = std::function<bool(packet_id_t packet_id, std::vector<unsubscribe_entry> entries)> |
Unsubscribe handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349810 3.10.2 Variable header |
entries | Collection of Share Name and Topic Filter See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc384800448 |
using MQTT_NS::callable_overlay< Impl >::v5_auth_handler = std::function< bool(v5::auth_reason_code reason_code, v5::properties props) > |
Auth handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901217
3.15 AUTH – Authentication exchange.
reason_code | AUTH Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901220 3.15.2.1 Authenticate Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901221 3.15.2.2 AUTH Properties |
using MQTT_NS::callable_overlay< Impl >::v5_connack_handler = std::function< bool(bool session_present, v5::connect_reason_code reason_code, v5::properties props) > |
Connack handler.
session_present | Session present flag. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901078 3.2.2.1.1 Session Present |
reason_code | Connect Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901079 3.2.2.2 Connect Reason code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901080 3.2.2.3 CONNACK Properties |
using MQTT_NS::callable_overlay< Impl >::v5_connect_handler = std::function< bool(buffer client_id, optional<buffer> user_name, optional<buffer> password, optional<will> will, bool clean_start, std::uint16_t keep_alive, v5::properties props) > |
Connect handler.
using MQTT_NS::callable_overlay< Impl >::v5_disconnect_handler = std::function< void(v5::disconnect_reason_code reason_code, v5::properties props) > |
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901205
3.14 DISCONNECT – Disconnect notification.
reason_code | DISCONNECT Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901208 3.14.2.1 Disconnect Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901209 3.14.2.2 DISCONNECT Properties |
using MQTT_NS::callable_overlay< Impl >::v5_puback_handler = std::function< bool(packet_id_t packet_id, v5::puback_reason_code reason_code, v5::properties props) > |
Puback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901123 3.4.2 Variable header |
reason_code | PUBACK Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901124 3.4.2.1 PUBACK Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901125 3.4.2.2 PUBACK Properties |
using MQTT_NS::callable_overlay< Impl >::v5_pubcomp_handler = std::function< bool(packet_id_t packet_id, v5::pubcomp_reason_code reason_code, v5::properties props) > |
Pubcomp handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901153 3.7.2 Variable header |
reason_code | PUBCOMP Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901154 3.7.2.1 PUBCOMP Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901155 3.7.2.2 PUBCOMP Properties |
using MQTT_NS::callable_overlay< Impl >::v5_publish_handler = std::function< bool(optional<packet_id_t> packet_id, publish_options pubopts, buffer topic_name, buffer contents, v5::properties props) > |
Publish handler.
packet_id | packet identifier If received publish's QoS is 0, packet_id is nullopt. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901108 3.3.2.2 Packet Identifier |
fixed_header | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901101 3.3.1 Fixed header You can check the fixed header using publish functions. |
topic_name | Topic name See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901107 3.3.2.1 Topic Name |
contents | Publish Payload See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901119 3.3.3 PUBLISH Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
using MQTT_NS::callable_overlay< Impl >::v5_pubrec_handler = std::function< bool(packet_id_t packet_id, v5::pubrec_reason_code reason_code, v5::properties props) > |
Pubrec handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901133 3.5.2 Variable header |
reason_code | PUBREC Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901134 3.5.2.1 PUBREC Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901135 3.5.2.2 PUBREC Properties |
using MQTT_NS::callable_overlay< Impl >::v5_pubrel_handler = std::function< bool(packet_id_t packet_id, v5::pubrel_reason_code reason_code, v5::properties props) > |
Pubrel handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901143 3.6.2 Variable header |
reason_code | PUBREL Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901144 3.6.2.1 PUBREL Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901145 3.6.2.2 PUBREL Properties |
using MQTT_NS::callable_overlay< Impl >::v5_suback_handler = std::function< bool(packet_id_t packet_id, std::vector<v5::suback_reason_code> reasons, v5::properties props) > |
Suback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901173 3.9.2 Variable header |
reasons | Collection of reason_code. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901178 3.9.3 SUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901174 3.9.2.1 SUBACK Properties |
using MQTT_NS::callable_overlay< Impl >::v5_subscribe_handler = std::function< bool(packet_id_t packet_id, std::vector<subscribe_entry> entries, v5::properties props) > |
Subscribe handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901163 3.8.2 Variable header |
entries | Collection of Share Name, Topic Filter, and Subscribe Options. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901168 |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties |
using MQTT_NS::callable_overlay< Impl >::v5_unsuback_handler = std::function< bool(packet_id_t, std::vector<v5::unsuback_reason_code> reasons, v5::properties props) > |
Unsuback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901189 3.11.2 Variable header |
reasons | Collection of reason_code. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901194 3.11.3 UNSUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901190 3.11.2.1 UNSUBACK Properties |
using MQTT_NS::callable_overlay< Impl >::v5_unsubscribe_handler = std::function< bool(packet_id_t packet_id, std::vector<unsubscribe_entry> entries, v5::properties props) > |
Unsubscribe handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901181 3.10.2 Variable header |
entries | Collection of Share Name and Topic Filter See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901185 3.10.3 UNSUBSCRIBE Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties |
|
inline |
|
default |
|
default |
|
default |
|
inlinefinaloverridenoexcept |
is valid length handler This handler is called when remaining length is received.
control_packet_type | control_packet_type that has variable length |
remaining | length |
|
inline |
Get close handler.
|
inline |
Get connack handler.
|
inline |
Get connect handler.
|
inline |
Get disconnect handler.
|
inline |
Get error handler.
|
inline |
Get check length handler.
|
inline |
Get mqtt_message_processed_handler.
|
inline |
Get pingreq handler.
|
inline |
Get pingresp handler.
|
inline |
Get pre-send handler.
|
inline |
Get publish response sent handler.
|
inline |
Get puback handler.
|
inline |
Get pubcomp handler.
|
inline |
Set publish handler.
|
inline |
Get pubrec handler.
|
inline |
Get pubrel handler.
|
inline |
Get serialize publish handler.
|
inline |
Get serialize pubrel handler.
|
inline |
Get serialize remove handler.
|
inline |
Get serialize publish handler.
|
inline |
Get serialize pubrel handler.
|
inline |
Get suback handler.
|
inline |
Get subscribe handler.
|
inline |
Get unsuback handler.
|
inline |
Get unsubscribe handler.
|
inline |
Get pubrec handler.
|
inline |
Get auth handler.
|
inline |
Get connack handler.
|
inline |
Get connect handler.
|
inline |
Get disconnect handler.
|
inline |
Get puback handler.
|
inline |
Get pubcomp handler.
|
inline |
Set publish handler.
|
inline |
Get pubrel handler.
|
inline |
Get suback handler.
|
inline |
Get subscribe handler.
|
inline |
Get unsuback handler.
|
inline |
Get unsubscribe handler.
|
inlinefinaloverridenoexcept |
Close handler.
This handler is called if the client called disconnect()
and the server closed the socket cleanly. If the socket is closed by other reasons, error_handler is called. This calls base::on_close() prior to calling the provided callback, if any.
|
inlinefinaloverridenoexcept |
Connack handler.
session_present | Session present flag. See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718036 3.2.2.2 Session Present |
return_code | connect_return_code See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718036 3.2.2.3 Connect Return code |
|
inlinefinaloverridenoexcept |
Connect handler.
|
inlinefinaloverridenoexcept |
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc384800463
3.14 DISCONNECT – Disconnect notification.
|
inlinefinaloverridenoexcept |
Error handler.
This handler is called if the socket is closed without client's disconnect()
call. This calls base::on_error() prior to calling the provided callback, if any.
ec | error code |
|
inlinefinaloverridenoexcept |
next read handler This handler is called when the current mqtt message has been processed. This calls base::on_mqtt_message_processed() only if mqtt_message_processed handler is not set.
client
inherits endpoint
and override on_pre_send()
, on_close()
, and on_error()
. And implement important process *1 in the override definition (timer reset, timer cancel).client
has set_pre_send_handler()
, set_on_close()
, and set_on_error()
. If a user of client
call them, and the event happens, set handler should be called. Either the user set handlers or not, *1 should be executed automatically.endpoint
has the default definition of on_mqtt_message_processed()
. client
doesn't override on_mqtt_message_processed()
. If a user override this, then the default definition shouldn't be called. It makes conflict behavior.on_*()
doesn't have the default definition. callable_overlay
calls the corresponding handler only if it is set. func | A callback function that is called when async operation will finish. |
|
inlinefinaloverridenoexcept |
Pingreq handler See http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718086
3.13 PINGREQ – PING request.
|
inlinefinaloverridenoexcept |
Pingresp handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901200
3.13 PINGRESP – PING response.
|
inlinefinaloverridenoexcept |
Pre-send handler This handler is called when any mqtt control packet is decided to send.
|
inlinefinaloverridenoexcept |
Publish response sent handler This function is called just after puback sent on QoS1, or pubcomp sent on QoS2.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901026 2.2.1 Packet Identifier |
|
inlinefinaloverridenoexcept |
Puback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718045 3.4.2 Variable header |
|
inlinefinaloverridenoexcept |
Pubcomp handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718060 3.7.2 Variable header |
|
inlinefinaloverridenoexcept |
Publish handler.
packet_id | packet identifier If received publish's QoS is 0, packet_id is nullopt. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718039 3.3.2 Variable header |
fixed_header | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718038 3.3.1 Fixed header You can check the fixed header using publish functions. |
topic_name | Topic name |
contents | Published contents |
|
inlinefinaloverridenoexcept |
Pubrec handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718050 3.5.2 Variable header |
|
inlinefinaloverridenoexcept |
Pubrel handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349791 3.6.2 Variable header |
|
inlinefinaloverridenoexcept |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message().
msg | publish message |
|
inlinefinaloverridenoexcept |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message().
msg | pubrel message |
|
inlinefinaloverridenoexcept |
Remove serialized message.
packet_id | packet identifier of the removing message |
|
inlinefinaloverridenoexcept |
Serialize publish handler You can serialize the publish message. To restore the message, use restore_serialized_message().
msg | v5::publish message |
|
inlinefinaloverridenoexcept |
Serialize pubrel handler You can serialize the pubrel message. If your storage has already had the publish message that has the same packet_id, then you need to replace the publish message to pubrel message. To restore the message, use restore_serialized_message().
msg | pubrel message |
|
inlinefinaloverridenoexcept |
Suback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718070 3.9.2 Variable header |
qoss | Collection of QoS that is corresponding to subscribed topic order. If subscription is failure, the value is nullopt. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718071 |
|
inlinefinaloverridenoexcept |
Subscribe handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349801 3.8.2 Variable header |
entries | Collection of Share Name, Topic Filter, and QoS. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349802 |
|
inlinefinaloverridenoexcept |
Unsuback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc398718045 3.11.2 Variable header |
|
inlinefinaloverridenoexcept |
Unsubscribe handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc385349810 3.10.2 Variable header |
topics | Collection of Share Name and Topic Filter See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc384800448 |
|
inlinefinaloverridenoexcept |
Auth handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901217
3.15 AUTH – Authentication exchange.
reason_code | AUTH Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901220 3.15.2.1 Authenticate Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901221 3.15.2.2 AUTH Properties |
|
inlinefinaloverridenoexcept |
Connack handler.
session_present | Session present flag. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901078 3.2.2.1.1 Session Present |
reason_code | Connect Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901079 3.2.2.2 Connect Reason code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901080 3.2.2.3 CONNACK Properties |
|
inlinefinaloverridenoexcept |
Connect handler.
|
inlinefinaloverridenoexcept |
Disconnect handler See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901205
3.14 DISCONNECT – Disconnect notification.
reason_code | DISCONNECT Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901208 3.14.2.1 Disconnect Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901209 3.14.2.2 DISCONNECT Properties |
|
inlinefinaloverridenoexcept |
Puback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901123 3.4.2 Variable header |
reason_code | PUBACK Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901124 3.4.2.1 PUBACK Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901125 3.4.2.2 PUBACK Properties |
|
inlinefinaloverridenoexcept |
Pubcomp handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901153 3.7.2 Variable header |
reason_code | PUBCOMP Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901154 3.7.2.1 PUBCOMP Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901155 3.7.2.2 PUBCOMP Properties |
|
inlinefinaloverridenoexcept |
Publish handler.
packet_id | packet identifier If received publish's QoS is 0, packet_id is nullopt. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901108 3.3.2.2 Packet Identifier |
fixed_header | See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901101 3.3.1 Fixed header You can check the fixed header using publish functions. |
topic_name | Topic name See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901107 3.3.2.1 Topic Name |
contents | Publish Payload See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901119 3.3.3 PUBLISH Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901109 3.3.2.3 PUBLISH Properties |
|
inlinefinaloverridenoexcept |
Pubrec handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901133 3.5.2 Variable header |
reason_code | PUBREC Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901134 3.5.2.1 PUBREC Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901135 3.5.2.2 PUBREC Properties |
|
inlinefinaloverridenoexcept |
Pubrel handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901143 3.6.2 Variable header |
reason_code | PUBREL Reason Code See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901144 3.6.2.1 PUBREL Reason Code |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901145 3.6.2.2 PUBREL Properties |
|
inlinefinaloverridenoexcept |
Suback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901173 3.9.2 Variable header |
reasons | Collection of reason_code. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901178 3.9.3 SUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901174 3.9.2.1 SUBACK Properties |
|
inlinefinaloverridenoexcept |
Subscribe handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901163 3.8.2 Variable header |
entries | Collection of Share Name, Topic Filter, and QoS. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901168 |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901164 3.8.2.1 SUBSCRIBE Properties |
|
inlinefinaloverridenoexcept |
Unsuback handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901189 3.11.2 Variable header |
reasons | Collection of reason_code. See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901194 3.11.3 UNSUBACK Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901190 3.11.2.1 UNSUBACK Properties |
|
inlinefinaloverridenoexcept |
Unsubscribe handler.
packet_id | packet identifier See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901181 3.10.2 Variable header |
entries | Collection of Share Name and Topic Filter See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901185 3.10.3 UNSUBSCRIBE Payload |
props | Properties See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901182 3.10.2.1 UNSUBSCRIBE Properties |
|
default |
|
default |
|
inline |
Set close handler.
h | handler |
|
inline |
Set connack handler.
h | handler |
|
inline |
Set connect handler.
h | handler |
|
inline |
Set disconnect handler.
h | handler |
|
inline |
Set error handler.
h | handler |
|
inline |
Set check length handler.
h | handler |
|
inline |
Set custom mqtt_message_processed_handler. The default setting is calling async_read_control_packet_type(). (See endpoint() constructor). The typical usecase of this function is delaying the next message reading timing. In order to do that 1) store func parameter of the mqtt_message_processed_handler. 2) call async_read_next_message with the stored func if you are ready to read the next mqtt message.
h | mqtt_message_processed_handler. |
|
inline |
Set pingreq handler.
h | handler |
|
inline |
Set pingresp handler.
h | handler |
|
inline |
Set pre-send handler.
h | handler |
|
inline |
Set pubcomp handler.
h | handler |
|
inline |
Set puback handler.
h | handler |
|
inline |
Set pubcomp handler.
h | handler |
|
inline |
Set publish handler.
h | handler |
|
inline |
Set pubrec handler.
h | handler |
|
inline |
Set pubrel handler.
h | handler |
|
inline |
Clear serialize handlers.
|
inline |
Set serialize handlers.
h_publish | serialize handler for publish message |
h_pubrel | serialize handler for pubrel message |
h_remove | remove handler for serialized message |
|
inline |
Set serialize handlers.
h_publish | serialize handler for publish message |
h_pubrel | serialize handler for pubrel message |
h_remove | remove handler for serialized message |
|
inline |
Set suback handler.
h | handler |
|
inline |
Set subscribe handler.
h | handler |
|
inline |
Set unsuback handler.
h | handler |
|
inline |
Set unsubscribe handler.
h | handler |
|
inline |
Set auth handler.
h | handler |
|
inline |
Set connack handler.
h | handler |
|
inline |
Set connect handler.
h | handler |
|
inline |
Set disconnect handler.
h | handler |
|
inline |
Set puback handler.
h | handler |
|
inline |
Set pubcomp handler.
h | handler |
|
inline |
Set publish handler.
h | handler |
|
inline |
Set pubrec handler.
h | handler |
|
inline |
Set pubrel handler.
h | handler |
|
inline |
Set serialize handlers.
h_publish | serialize handler for publish message |
h_pubrel | serialize handler for pubrel message |
h_remove | remove handler for serialized message |
|
inline |
Set serialize handlers.
h_publish | serialize handler for publish message |
h_pubrel | serialize handler for pubrel message |
h_remove | remove handler for serialized message |
|
inline |
Set suback handler.
h | handler |
|
inline |
Set subscribe handler.
h | handler |
|
inline |
Set unsuback handler.
h | handler |
|
inline |
Set unsubscribe handler.
h | handler |