MQTTnet Definitions

 

Public Class MqttFactory
Implements IMqttClientFactory, IMqttServerFactory
Public Function CreateMqttClient() As IMqttClient
Public Function CreateMqttClient(logger As IMqttNetLogger) As IMqttClient
Public Function CreateMqttClient(adapterFactory As IMqttClientAdapterFactory) As IMqttClient
Public Function CreateMqttClient(logger As IMqttNetLogger, adapterFactory As IMqttClientAdapterFactory) As IMqttClient
Public Function CreateMqttServer() As IMqttServer
Public Function CreateMqttServer(logger As IMqttNetLogger) As IMqttServer
Public Function CreateMqttServer(adapters As IEnumerable(Of IMqttServerAdapter), logger As IMqttNetLogger) As IMqttServer



Public Interface IMqttClient
Implements IApplicationMessageReceiver, IApplicationMessagePublisher, IDisposable
ReadOnly Property IsConnected As Boolean
ReadOnly Property Options As IMqttClientOptions
Event Connected As EventHandler(Of MqttClientConnectedEventArgs)
Event Disconnected As EventHandler(Of MqttClientDisconnectedEventArgs)
Function ConnectAsync(options As IMqttClientOptions) As Task(Of MqttClientConnectResult)
Function DisconnectAsync() As Task
Function SubscribeAsync(topicFilters As IEnumerable(Of TopicFilter)) As Task(Of IList(Of MqttSubscribeResult))
Function UnsubscribeAsync(topics As IEnumerable(Of String)) As Task



Public Interface IMqttClientOptions
ReadOnly Property ClientId As String
ReadOnly Property CleanSession As Boolean
ReadOnly Property Credentials As IMqttClientCredentials
ReadOnly Property ProtocolVersion As MqttProtocolVersion
ReadOnly Property ChannelOptions As IMqttClientChannelOptions
ReadOnly Property CommunicationTimeout As TimeSpan
ReadOnly Property KeepAlivePeriod As TimeSpan
ReadOnly Property KeepAliveSendInterval As TimeSpan?
ReadOnly Property WillMessage As MqttApplicationMessage



Public Class MqttClientOptionsBuilder
Public Function WithProtocolVersion(value As MqttProtocolVersion) As MqttClientOptionsBuilder
Public Function WithCommunicationTimeout(value As TimeSpan) As MqttClientOptionsBuilder
Public Function WithCleanSession(Optional value As Boolean = True) As MqttClientOptionsBuilder
Public Function WithKeepAlivePeriod(value As TimeSpan) As MqttClientOptionsBuilder
Public Function WithKeepAliveSendInterval(value As TimeSpan) As MqttClientOptionsBuilder
Public Function WithClientId(value As String) As MqttClientOptionsBuilder
Public Function WithWillMessage(value As MqttApplicationMessage) As MqttClientOptionsBuilder
Public Function WithCredentials(username As String, Optional password As String = Nothing) As MqttClientOptionsBuilder
Public Function WithTcpServer(server As String, Optional port As Integer? = Nothing) As MqttClientOptionsBuilder
Public Function WithProxy(address As String, Optional username As String = Nothing, Optional password As String = Nothing, Optional domain As String = Nothing, Optional bypassOnLocal As Boolean = False, Optional bypassList() As String = Nothing) As MqttClientOptionsBuilder
Public Function WithWebSocketServer(uri As String) As MqttClientOptionsBuilder
Public Function WithTls(parameters As MqttClientOptionsBuilderTlsParameters) As MqttClientOptionsBuilder
Public Function WithTls() As MqttClientOptionsBuilder
Obsolete("Use method _WithTls_ which accepts the _MqttClientOptionsBuilderTlsParameters_.")
Public Function WithTls(Optional allowUntrustedCertificates As Boolean = False, Optional ignoreCertificateChainErrors As Boolean = False, Optional ignoreCertificateRevocationErrors As Boolean = False, ParamArray certificates As Byte()() = Nothing) As MqttClientOptionsBuilder
Public Function Build() As IMqttClientOptions



Public Class TopicFilterBuilder
Public Function WithTopic(topic As String) As TopicFilterBuilder
Public Function WithQualityOfServiceLevel(qualityOfServiceLevel As MqttQualityOfServiceLevel) As TopicFilterBuilder
Public Function WithAtLeastOnceQoS() As TopicFilterBuilder
Public Function WithAtMostOnceQoS() As TopicFilterBuilder
Public Function WithExactlyOnceQoS() As TopicFilterBuilder
Public Function Build() As TopicFilter



Public Class MqttApplicationMessageBuilder
Public Function WithTopic(topic As String) As MqttApplicationMessageBuilder
Public Function WithPayload(payload As IEnumerable(Of Byte)) As MqttApplicationMessageBuilder
Public Function WithPayload(payload As Stream) As MqttApplicationMessageBuilder
Public Function WithPayload(payload As Stream, length As Long) As MqttApplicationMessageBuilder
Public Function WithPayload(payload As String) As MqttApplicationMessageBuilder
Public Function WithQualityOfServiceLevel(qualityOfServiceLevel As MqttQualityOfServiceLevel) As MqttApplicationMessageBuilder
Public Function WithRetainFlag(Optional value As Boolean = True) As MqttApplicationMessageBuilder
Public Function WithAtLeastOnceQoS() As MqttApplicationMessageBuilder
Public Function WithAtMostOnceQoS() As MqttApplicationMessageBuilder
Public Function WithExactlyOnceQoS() As MqttApplicationMessageBuilder
Public Function Build() As MqttApplicationMessage