Interface IMqttConnectable
This interface provides extended methods, based on the interfaces IConnectable
and IAsyncConnectable
in order to build mqtt connections to external brokers.
Inherited Members
Namespace: TeleScope.Connectors.Mqtt.Abstractions
Assembly: TeleScope.Connectors.Mqtt.Abstractions.dll
Syntax
public interface IMqttConnectable : IConnectable, IAsyncConnectable
Methods
| Improve this Doc View SourcePublishAsync(String, String)
Sends a message string asynchronously to a given broker.
Declaration
Task PublishAsync(string topic, string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | topic | The topic of the message. |
System.String | message | The message that will be sent. |
Returns
Type | Description |
---|---|
Task | The executing task. |
PublishAsync(String, String, Int32)
Sends a message string asynchronously to a given broker.
Declaration
Task PublishAsync(string topic, string message, int qualityOfService)
Parameters
Type | Name | Description |
---|---|---|
System.String | topic | The topic of the message. |
System.String | message | The message that will be sent. |
System.Int32 | qualityOfService | The level of quality that will be used for sending. |
Returns
Type | Description |
---|---|
Task | The executing task. |
Subscribe(String)
Subscribes to a new topic that the client will listen to.
Declaration
IMqttConnectable Subscribe(string topic)
Parameters
Type | Name | Description |
---|---|---|
System.String | topic | The topic of interest. |
Returns
Type | Description |
---|---|
IMqttConnectable | The calling instance. |
Unsubscribe(String)
Unsubscribes from a topic that the client will no longer listen to.
Declaration
IMqttConnectable Unsubscribe(string topic)
Parameters
Type | Name | Description |
---|---|---|
System.String | topic | The topic that will be removed. |
Returns
Type | Description |
---|---|
IMqttConnectable | The calling instance. |