|
| session_state (as::io_context &ioc, sub_con_map &subs_map, shared_target &shared_targets, con_sp_t con, buffer client_id, optional< will > will, optional< std::chrono::steady_clock::duration > will_expiry_interval, optional< std::chrono::steady_clock::duration > session_expiry_interval=nullopt) |
|
| session_state (session_state &&)=default |
|
| ~session_state () |
|
bool | online () const |
|
template<typename SessionExpireHandler > |
void | become_offline (SessionExpireHandler &&h) |
|
void | renew_session_expiry (optional< std::chrono::steady_clock::duration > v) |
|
std::shared_ptr< as::steady_timer > const & | tim_session_expiry () const |
|
void | publish (as::io_context &ioc, buffer pub_topic, buffer contents, publish_options pubopts, v5::properties props) |
|
void | deliver (as::io_context &ioc, buffer pub_topic, buffer contents, publish_options pubopts, v5::properties props) |
|
void | clean () |
|
void | exactly_once_start (packet_id_t packet_id) |
|
bool | exactly_once_processing (packet_id_t packet_id) const |
|
void | exactly_once_finish (packet_id_t packet_id) |
|
template<typename PublishRetainHandler > |
void | subscribe (buffer share_name, buffer topic_filter, subscribe_options subopts, PublishRetainHandler &&h, optional< std::size_t > sid=nullopt) |
|
void | unsubscribe (buffer const &share_name, buffer const &topic_filter) |
|
void | unsubscribe_all () |
|
void | update_will (as::io_context &ioc, optional< MQTT_NS::will > will, optional< std::chrono::steady_clock::duration > will_expiry_interval) |
|
void | reset_will () |
|
void | insert_inflight_message (store_message_variant msg, any life_keeper, std::shared_ptr< as::steady_timer > tim_message_expiry) |
|
void | send_inflight_messages () |
|
void | erase_inflight_message_by_expiry (std::shared_ptr< as::steady_timer > const &sp) |
|
void | erase_inflight_message_by_packet_id (packet_id_t packet_id) |
|
void | send_all_offline_messages () |
|
void | send_offline_messages_by_packet_id_release () |
|
buffer const & | client_id () const |
|
void | reset_con () |
|
void | reset_con (con_sp_t con) |
|
con_sp_t const & | con () const |
|
optional< std::chrono::steady_clock::duration > | session_expiry_interval () const |
|
optional< MQTT_NS::will > & | will () |
|
optional< MQTT_NS::will > const & | will () const |
|
std::shared_ptr< as::steady_timer > & | get_tim_will_expiry () |
|
http://docs.oasis-open.org/mqtt/mqtt/v5.0/cs02/mqtt-v5.0-cs02.html#_Session_State
4.1 Session State In order to implement QoS 1 and QoS 2 protocol flows the Client and Server need to associate state with the Client Identifier, this is referred to as the Session State. The Server also stores the subscriptions as part of the Session State. The session can continue across a sequence of Network Connections. It lasts as long as the latest Network Connection plus the Session Expiry Interval. The Session State in the Server consists of: · The existence of a Session, even if the rest of the Session State is empty. · The Clients subscriptions, including any Subscription Identifiers. · QoS 1 and QoS 2 messages which have been sent to the Client, but have not been completely acknowledged. · QoS 1 and QoS 2 messages pending transmission to the Client and OPTIONALLY QoS 0 messages pending transmission to the Client. · QoS 2 messages which have been received from the Client, but have not been completely acknowledged. · The Will Message and the Will Delay Interval · If the Session is currently not connected, the time at which the Session will end and Session State will be discarded.
Retained messages do not form part of the Session State in the Server, they are not deleted as a result of a Session ending.