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.
Constructors
- MqttConnectionKeepAlive(MqttIConnectionHandler connectionHandler, int keepAliveSeconds)
- Initializes a new instance of the MqttConnectionKeepAlive class.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- keepAlivePeriod ↔ int
-
The keep alive period in milliseconds
getter/setter pair
- pingTimer ↔ Timer?
-
The timer that manages the ping callbacks.
getter/setter pair
- pongCallback ↔ PongCallback?
-
Ping response received callback
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
messageSent(
MqttMessage? msg) → bool - Handles the MessageSent event of the connectionHandler control.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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 -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited