MqttConnectMessage class

An Mqtt message that is used to initiate a connection to a message broker.



Initializes a new instance of the MqttConnectMessage class. Only called via the MqttMessage.create operation during processing of an Mqtt message stream.
MqttConnectMessage.fromByteBuffer(MqttHeader header, MqttByteBuffer messageStream)
Initializes a new instance of the MqttConnectMessage class.


hashCode → int
The hash code for this object. [...]
read-only, inherited
The header of the MQTT Message. Contains metadata about the message
read / write, inherited
payload MqttConnectPayload
The payload of the Mqtt Message.
read / write
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
variableHeader MqttConnectVariableHeader
The variable header contents. Contains extended metadata about the message
read / write


authenticateAs(String username, String password) MqttConnectMessage
Sets the authentication
keepAliveFor(int keepAliveSeconds) MqttConnectMessage
Sets the keep alive period
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
readFrom(MqttByteBuffer messageStream) → void
Reads a message from the supplied stream.
startClean() MqttConnectMessage
Sets the startClean flag so that the broker drops any messages that were previously destined for us.
toString() → String
Returns a string representation of this object.
will() MqttConnectMessage
Sets the Will flag of the variable header
withClientIdentifier(String clientIdentifier) MqttConnectMessage
Sets the client identifier of the message.
withProtocolName(String protocolName) MqttConnectMessage
Sets the name of the protocol to use.
withProtocolVersion(int protocolVersion) MqttConnectMessage
Sets the protocol version. (Defaults to v3, the only protcol version supported)
withWillMessage(String willMessage) MqttConnectMessage
Sets the will message.
withWillQos(MqttQos qos) MqttConnectMessage
Sets the WillQos of the connect flag.
withWillRetain() MqttConnectMessage
Sets the WillRetain flag of the Connection Flags
withWillTopic(String willTopic) MqttConnectMessage
Sets the Will Topic
writeTo(MqttByteBuffer messageStream) → void
Writes the message to the supplied stream.


operator ==(Object other) → bool
The equality operator. [...]