MqttTransport class abstract interface

The connection to an MQTT broker, as the rest of the package sees it.

This is the only seam to the MQTT library. The real implementation wraps mqtt_client; tests use MemoryTransport.

A transport is simple on purpose. It does not reconnect, queue, or remember subscriptions: when the connection drops, subscriptions are gone and state becomes TransportState.disconnected. The layers above handle all of that.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
messages → Stream<RawMessage>
Messages that arrive on any subscribed filter.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → TransportState
The current connection state.
no setter
states → Stream<TransportState>
Every change of state.
no setter

Methods

connect({RawMessage? lastWill}) → Future<void>
Connects to the broker.
disconnect() → Future<void>
Closes the connection on purpose. The last will is not published.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publish(RawMessage message) → Future<void>
Sends message to the broker.
subscribe(String filter, Qos qos) → Future<void>
Starts receiving messages that match filter on messages.
toString() → String
A string representation of this object.
inherited
unsubscribe(String filter) → Future<void>
Stops receiving messages for filter.

Operators

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