SynchronousMqttBrowserConnectionHandler class Null safety

Connection handler that performs connections and disconnections to the hostname in a synchronous manner.



SynchronousMqttBrowserConnectionHandler(dynamic clientEventBus, {required int maxConnectionAttempts})
Initializes a new instance of the MqttConnectionHandler class.


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


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


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