MqttConnectionHandlerBase class abstract

This class provides shared connection functionality to serverand browser connection handler implementations.

Implemented types
Implementers

Constructors

MqttConnectionHandlerBase(EventBus? clientEventBus, {required int? maxConnectionAttempts})
Initializes a new instance of the MqttConnectionHandlerBase class.

Properties

autoReconnectInProgress bool
Auto reconnect in progress
getter/setter pairoverride
clientEventBus ↔ EventBus?
The event bus
getter/setter pair
connection MqttConnectionBase<Object>
The connection
getter/setter pair
connectionMessage MqttConnectMessage?
getter/setter pairoverride
connectionStatus MqttClientConnectionStatus
Connection status
getter/setter pairoverride-getter
connectTimer MqttCancellableAsyncSleep
The broker connection acknowledgment timer
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
initialConnectionComplete bool
We have had an initial connection
getter/setter pair
maxConnectionAttempts int?
Max connection attempts
final
messageProcessorRegistry Map<MqttMessageType, MessageCallbackFunction?>
Registry of message processors
getter/setter pair
onAutoReconnect AutoReconnectCallback?
Auto reconnect callback
getter/setter pairoverride
onAutoReconnected AutoReconnectCompleteCallback?
Auto reconnected callback
getter/setter pairoverride
onBadCertificate bool Function(Object certificate)?
Callback function to handle bad certificate. if true, ignore the error.
getter/setter pairoverride
onConnected ConnectCallback?
Successful connection callback.
getter/setter pairoverride
onDisconnected DisconnectCallback?
Unsolicited disconnection callback.
getter/setter pairoverride
port int?
getter/setter pairoverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sentMessageCallbacks List<MessageCallbackFunction>
Registry of sent message callbacks
getter/setter pair
server String?
getter/setter pairoverride
websocketProtocols List<String>?
User supplied websocket protocols
getter/setter pair

Methods

autoReconnect(AutoReconnect reconnectEvent) → void
Auto reconnect
close() → void
Closes the connection to the Mqtt message broker.
override
connect(String server, int port, MqttConnectMessage? message) Future<MqttClientConnectionStatus>
Connect to the specific Mqtt Connection.
override
connectAckProcessor(MqttMessage msg) bool
Processes the connect acknowledgement message.
connectAckReceived(ConnectAckMessageAvailable event) → void
Connect acknowledge recieved
disconnect() MqttConnectionState
Disconnects
override
initialiseListeners() → void
Initialise the event listeners;
internalConnect(String hostname, int port, MqttConnectMessage? message) Future<MqttClientConnectionStatus>
Connect to the specific Mqtt Connection internally.
messageAvailable(MessageAvailable event) → void
Handles the Message Available event of the connection control for handling non connection messages.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerForAllSentMessages(MessageCallbackFunction sentMsgCallback) → void
Registers a callback to be called whenever a message is sent.
override
registerForMessage(MqttMessageType msgType, MessageCallbackFunction? callback) → void
Registers for the receipt of messages when they arrive.
override
sendMessage(MqttMessage? message) → void
Sends a message to the broker through the current connection.
override
stopListening() → void
Kills all listeners from old connections.
override
toString() String
A string representation of this object.
inherited
unRegisterForAllSentMessages(MessageCallbackFunction sentMsgCallback) → void
UnRegisters a callback that is called whenever a message is sent.
override
unRegisterForMessage(MqttMessageType msgType) → void
UnRegisters for the receipt of messages when they arrive.
override

Operators

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