MqttDisconnectMessage class

The disconnect message is the final MQTT Control Packet sent from the client or the broker. It indicates the reason why the network connection is being closed. The client or broker may send a disconnect message before closing the network connection.

If the network connection is closed without the client first sending a disconnect message with reason code normal disconnection and the connection has a will message, the will message is published.

Inheritance

Constructors

MqttDisconnectMessage()
Initializes a new instance of the MqttDisconnectMessage class.
MqttDisconnectMessage.fromByteBuffer(MqttHeader header, MqttByteBuffer messageStream)
Initializes a new instance of the MqttDisconnectMessage class from a message stream.
MqttDisconnectMessage.fromHeader(MqttHeader header)
Initializes a new instance of the MqttDisconnectMessage class from a supplied header.

Properties

hashCode int
The hash code for this object.
no setterinherited
The header of the MQTT Message. Contains metadata about the message
getter/setter pairinherited
isValid bool
Is valid
no setteroverride
reasonCode MqttDisconnectReasonCode?
Gets the reason code of the message.
no setter
reasonString String?
Gets the reason string
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverReference String?
Gets the server reference.
no setter
sessionExpiryInterval int?
Gets the session expiry interval.
no setter
userProperties List<MqttUserProperty>
Get the user properties
no setter
variableHeader MqttDisconnectVariableHeader?
no setter

Methods

addUserProperty(MqttUserProperty property) → void
Add a specific user property
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readFrom(MqttByteBuffer messageStream) → void
Reads a message from the supplied stream.
override
toString() String
A string representation of this object.
override
withReasonCode(MqttDisconnectReasonCode reasonCode) MqttDisconnectMessage
Sets the reason code of the message.
withReasonString(String reason) MqttDisconnectMessage
Sets the reason string
withServerReference(String reference) MqttDisconnectMessage
Sets the server reference.
withSessionExpiryInterval(int interval) MqttDisconnectMessage
Sets the session expiry interval.
withUserProperties(List<MqttUserProperty> properties) MqttDisconnectMessage
Sets a list of user properties
writeTo(MqttByteBuffer messageStream) → void
Writes the message to the supplied stream.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited