IPWorks IoT 2020 ActiveX Edition

Questions / Feedback?

CleanSession Property

Determines whether a clean session is used once connected.

Syntax

mqttsncontrol.CleanSession[=boolean]

Default Value

True

Remarks

This property determines whether or not the control should instruct the server to use a clean session when it connects. (Note that this property must be set to the desired value before calling Connect.)

By default, CleanSession is true, so the server will discard any state data previously associated with the current ClientId once the control has connected successfully. In addition, the server will not save any state data when the control disconnects.

Setting CleanSession to False before connecting will cause the server to re-associate any previously stored state data for the current ClientId. The server will also save any state data that exists when the control is disconnected.

The server-side session state consists of:

  • client subscriptions,
  • QoS 1 and 2 messages which are buffering or unacknowledged,
  • QoS 2 messages received from the client but not completely acknowledged, and
  • the WillMessage and WillTopic if set.

Note that retained messages are not deleted as a result of a session ending, but are not part of the session state.

This property is not available at design time.

Data Type

Boolean

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 ActiveX Edition - Version 20.0 [Build 8265]