MqttBrokerConnection class

Implemented types

Constructors

MqttBrokerConnection({@required String server, @required int port, String clientIdentifier, String username, String password})

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

connect(String lastWillTopic, Uint8List lastWillData, bool lastWillRetained, int lastWillQos) Future<Null>
Connects to the mqtt broker. The connection must respect the last will parameters. The connect method of each instance may only be called once. If it is called a second time on the same instance a StateError must be thrown.
override
disconnect() Future<Null>
Disconnects from the mqtt broker and cancels all subscriptions.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
publish(String topic, Uint8List data, bool retained, int qos) Future<Null>
Publishes data to topic with respect to retained. Awaiting the returned future should guarantee the publishing of the message to the broker with respect to the quality of service qos. A qos of 0 does not guarentee anything and might return immediately. If this is called while disconnecting, a DisconnectingError should be thrown
override
subscribe(String topic, int qos) Future<Stream<Uint8List>>
Subscribes to topic. Awaiting the returned future gives a Stream whichs events are incoming messages on the topic. If this is called while disconnecting, a DisconnectingError should be thrown.
override
toString() String
A string representation of this object. [...]
inherited

Operators

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