SynchronousMqttBrowserConnectionHandler class

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

Inheritance

Constructors

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

Properties

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

Methods

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

Operators

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