MqttConnectionKeepAlive class

Implements keepalive functionality on the Mqtt Connection, ensuring that the connection remains active according to the keepalive seconds setting. This class implements the keepalive by sending an MqttPingRequest to the broker if a message has not been sent or received within the keepalive period.


MqttConnectionKeepAlive(IMqttConnectionHandler connectionHandler, int keepAliveSeconds)
Initializes a new instance of the MqttConnectionKeepAlive class.


hashCode int
The hash code for this object. [...]
read-only, inherited
keepAlivePeriod int
The keep alive period in milliseconds
read / write
pingTimer Timer
The timer that manages the ping callbacks.
read / write
pongCallback PongCallback
Ping response received callback
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


messageSent(MqttMessage msg) bool
Handles the MessageSent event of the connectionHandler control.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
pingRequestReceived(MqttMessage pingMsg) bool
Signal to the keepalive that a ping request has been received from the message broker. The effect of calling this method on the keepalive handler is the transmission of a ping response message to the message broker on the current connection.
pingRequired() bool
Pings the message broker if there has been no activity for the specified amount of idle time.
pingResponseReceived(MqttMessage pingMsg) bool
Processed ping response messages received from a message broker.
stop() → void
Stop the keep alive process
toString() String
Returns a string representation of this object.


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