Operational behavior 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 Client consists of: QoS 1 and QoS 2 messages which have been sent to the Server, but have not been completely acknowledged. QoS 2 messages which have been received from the Server, but have not been completely acknowledged. The Session State in the Server consists of: The existence of a Session, even if the rest of the Session 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. Storing Session State The Client and Server MUST NOT discard the Session State while the Network Connection is open [MQTT-4.1.0-1]. The Server MUST discard the Session State when the Network Connection is closed and the Session Expiry Interval has passed [MQTT-4.1.0-2]. Non-normative comment The storage capabilities of Client and Server implementations will of course have limits in terms of capacity and may be subject to administrative policies. Stored Session State can be discarded as a result of an administrator action, including an automated response to defined conditions. This has the effect of terminating the Session. These actions might be prompted by resource constraints or for other operational reasons. It is possible that hardware or software failures may result in loss or corruption of Session State stored by the Client or Server. It is prudent to evaluate the storage capabilities of the Client and Server to ensure that they are sufficient.
Operational behavior 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 Client consists of: QoS 1 and QoS 2 messages which have been sent to the Server, but have not been completely acknowledged. QoS 2 messages which have been received from the Server, but have not been completely acknowledged. The Session State in the Server consists of: The existence of a Session, even if the rest of the Session 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. Storing Session State The Client and Server MUST NOT discard the Session State while the Network Connection is open [MQTT-4.1.0-1]. The Server MUST discard the Session State when the Network Connection is closed and the Session Expiry Interval has passed [MQTT-4.1.0-2]. Non-normative comment The storage capabilities of Client and Server implementations will of course have limits in terms of capacity and may be subject to administrative policies. Stored Session State can be discarded as a result of an administrator action, including an automated response to defined conditions. This has the effect of terminating the Session. These actions might be prompted by resource constraints or for other operational reasons. It is possible that hardware or software failures may result in loss or corruption of Session State stored by the Client or Server. It is prudent to evaluate the storage capabilities of the Client and Server to ensure that they are sufficient.