Table of Contents

Class MqttClientConfigurationBuilder

Namespace
Silverback.Messaging.Configuration.Mqtt
Assembly
Silverback.Integration.MQTT.dll
public class MqttClientConfigurationBuilder
Inheritance
MqttClientConfigurationBuilder
Inherited Members

Constructors

MqttClientConfigurationBuilder(IServiceProvider)

Initializes a new instance of the MqttClientConfigurationBuilder class.

public MqttClientConfigurationBuilder(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

The IServiceProvider to be used to resolve the required services.

Properties

ServiceProvider

Gets the IServiceProvider instance to be used to resolve the required services.

public IServiceProvider ServiceProvider { get; }

Property Value

IServiceProvider

Methods

AddUserProperty(string, string?)

Adds a user property to be sent with the CONNECT packet. It can be used to send connection related properties from the client to the server.

public MqttClientConfigurationBuilder AddUserProperty(string name, string? value)

Parameters

name string

The property name.

value string

The property value.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

AllowPacketFragmentation()

Allow packet fragmentation. This is the default, use DisablePacketFragmentation() to turn it off.

public MqttClientConfigurationBuilder AllowPacketFragmentation()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Build()

Builds the MqttClientConfiguration instance.

public MqttClientConfiguration Build()

Returns

MqttClientConfiguration

The MqttClientConfiguration.

ConnectTo(string)

Specifies the URI of the MQTT server.

public MqttClientConfigurationBuilder ConnectTo(string serverUri)

Parameters

serverUri string

The URI of the MQTT server.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

ConnectTo(Uri)

Specifies the URI of the MQTT server.

public MqttClientConfigurationBuilder ConnectTo(Uri serverUri)

Parameters

serverUri Uri

The URI of the MQTT server.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

ConnectViaTcp(Action<MqttClientTcpConfigurationBuilder>)

Specifies the TCP connection settings using only a builder action to configure all TCP options.

public MqttClientConfigurationBuilder ConnectViaTcp(Action<MqttClientTcpConfigurationBuilder> tcpConfigurationBuilderAction)

Parameters

tcpConfigurationBuilderAction Action<MqttClientTcpConfigurationBuilder>

The action that configures the MqttClientTcpConfigurationBuilder.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

ConnectViaTcp(EndPoint, Action<MqttClientTcpConfigurationBuilder>?)

Specifies the TCP connection settings using an EndPoint and an optional builder to configure additional TCP options.

public MqttClientConfigurationBuilder ConnectViaTcp(EndPoint endpoint, Action<MqttClientTcpConfigurationBuilder>? tcpConfigurationBuilderAction = null)

Parameters

endpoint EndPoint

The remote endpoint.

tcpConfigurationBuilderAction Action<MqttClientTcpConfigurationBuilder>

An optional action that configures the MqttClientTcpConfigurationBuilder.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

ConnectViaTcp(string, Action<MqttClientTcpConfigurationBuilder>?)

Specifies the TCP connection settings using the host name and an optional builder to configure additional TCP options.

public MqttClientConfigurationBuilder ConnectViaTcp(string host, Action<MqttClientTcpConfigurationBuilder>? tcpConfigurationBuilderAction = null)

Parameters

host string

The server host name or IP address.

tcpConfigurationBuilderAction Action<MqttClientTcpConfigurationBuilder>

An optional action that configures the MqttClientTcpConfigurationBuilder.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

ConnectViaTcp(string, int, Action<MqttClientTcpConfigurationBuilder>?)

Specifies the TCP connection settings using the host name, port and an optional builder to configure additional TCP options.

public MqttClientConfigurationBuilder ConnectViaTcp(string host, int port, Action<MqttClientTcpConfigurationBuilder>? tcpConfigurationBuilderAction = null)

Parameters

host string

The server host name or IP address.

port int

The server port.

tcpConfigurationBuilderAction Action<MqttClientTcpConfigurationBuilder>

An optional action that configures the MqttClientTcpConfigurationBuilder.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

ConnectViaWebSocket(Action<MqttClientWebSocketConfigurationBuilder>)

Specifies the WebSocket connection settings.

public MqttClientConfigurationBuilder ConnectViaWebSocket(Action<MqttClientWebSocketConfigurationBuilder> webSocketConfigurationBuilderAction)

Parameters

webSocketConfigurationBuilderAction Action<MqttClientWebSocketConfigurationBuilder>

The action that configures the MqttClientWebSocketConfigurationBuilder.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

ConnectViaWebSocket(string, Action<MqttClientWebSocketConfigurationBuilder>?)

Specifies the WebSocket connection settings.

public MqttClientConfigurationBuilder ConnectViaWebSocket(string uri, Action<MqttClientWebSocketConfigurationBuilder>? webSocketConfigurationBuilderAction = null)

Parameters

uri string

The server URI.

webSocketConfigurationBuilderAction Action<MqttClientWebSocketConfigurationBuilder>

The action that configures the MqttClientWebSocketConfigurationBuilder.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Consume(Action<MqttConsumerEndpointConfigurationBuilder<object>>)

Adds a consumer endpoint, which is a topic or a group of topics that share the same configuration (deserializer, error policies, etc.).

public MqttClientConfigurationBuilder Consume(Action<MqttConsumerEndpointConfigurationBuilder<object>> configurationBuilderAction)

Parameters

configurationBuilderAction Action<MqttConsumerEndpointConfigurationBuilder<object>>

An Action that takes the MqttClientConfigurationBuilder and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Consume(string?, Action<MqttConsumerEndpointConfigurationBuilder<object>>)

Adds a consumer endpoint, which is a topic or a group of topics that share the same configuration (deserializer, error policies, etc.).

public MqttClientConfigurationBuilder Consume(string? name, Action<MqttConsumerEndpointConfigurationBuilder<object>> configurationBuilderAction)

Parameters

name string

The name is used to guarantee that a duplicated configuration is discarded and is also displayed in the logs. By default, the name will be generated concatenating the topic name(s).

configurationBuilderAction Action<MqttConsumerEndpointConfigurationBuilder<object>>

An Action that takes the MqttClientConfigurationBuilder and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Consume<TMessage>(Action<MqttConsumerEndpointConfigurationBuilder<TMessage>>)

Adds a consumer endpoint, which is a topic or a group of topics that share the same configuration (deserializer, error policies, etc.).

public MqttClientConfigurationBuilder Consume<TMessage>(Action<MqttConsumerEndpointConfigurationBuilder<TMessage>> configurationBuilderAction)

Parameters

configurationBuilderAction Action<MqttConsumerEndpointConfigurationBuilder<TMessage>>

An Action that takes the MqttClientConfigurationBuilder and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Type Parameters

TMessage

The type (or base type) of the messages being consumed. This is used to setup the deserializer and will determine the type of the message parameter in the nested configuration functions.

Consume<TMessage>(string?, Action<MqttConsumerEndpointConfigurationBuilder<TMessage>>)

Adds a consumer endpoint, which is a topic or a group of topics that share the same configuration (deserializer, error policies, etc.).

public MqttClientConfigurationBuilder Consume<TMessage>(string? name, Action<MqttConsumerEndpointConfigurationBuilder<TMessage>> configurationBuilderAction)

Parameters

name string

The name is used to guarantee that a duplicated configuration is discarded and is also displayed in the logs. By default, the name will be generated concatenating the topic name(s).

configurationBuilderAction Action<MqttConsumerEndpointConfigurationBuilder<TMessage>>

An Action that takes the MqttClientConfigurationBuilder and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Type Parameters

TMessage

The type (or base type) of the messages being consumed. This is used to setup the deserializer and will determine the type of the message parameter in the nested configuration functions.

DisableKeepAlive()

Disables the keep alive mechanism. No ping packet will be sent.

public MqttClientConfigurationBuilder DisableKeepAlive()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

DisablePacketFragmentation()

Disables packet fragmentation. This is necessary when the broker does not support it.

public MqttClientConfigurationBuilder DisablePacketFragmentation()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

DisableParallelProcessing()

Disables parallel messages processing, setting the max degree of parallelism to 1 (default).

public MqttClientConfigurationBuilder DisableParallelProcessing()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

DisableProblemInformation()

Specifies that the reason string or user properties can be sent with CONNACK or DISCONNECT packets only.

public MqttClientConfigurationBuilder DisableProblemInformation()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

DisableResponseInformation()

Specifies that the server should not return the response information in the CONNACK packet. This is usually the default.

public MqttClientConfigurationBuilder DisableResponseInformation()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

DisableTls()

Disables TLS. The network traffic will not be encrypted.

public MqttClientConfigurationBuilder DisableTls()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

DisableTryPrivate()

Disables the TryPrivate.

public MqttClientConfigurationBuilder DisableTryPrivate()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

EnableParallelProcessing(int)

Enables parallel processing and sets the maximum number of incoming messages that can be processed concurrently.

public MqttClientConfigurationBuilder EnableParallelProcessing(int maxDegreeOfParallelism)

Parameters

maxDegreeOfParallelism int

The maximum number of incoming messages that can be processed concurrently.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

EnableTls(Action<MqttClientTlsConfigurationBuilder>?)

Specifies that TLS has to be used to encrypt the network traffic.

public MqttClientConfigurationBuilder EnableTls(Action<MqttClientTlsConfigurationBuilder>? tlsConfigurationBuilderAction = null)

Parameters

tlsConfigurationBuilderAction Action<MqttClientTlsConfigurationBuilder>

The action that configures the MqttClientTlsConfigurationBuilder.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

EnableTryPrivate()

Specifies that the bridge must attempt to indicate to the remote broker that it is a bridge and not an ordinary client. If successful, this means that the loop detection will be more effective and that the retained messages will be propagated correctly. Not all brokers support this feature, so it may be necessary to disable it if your bridge does not connect properly.

public MqttClientConfigurationBuilder EnableTryPrivate()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

LimitBackpressure(int)

Sets the maximum number of messages to be consumed and enqueued waiting to be processed. The limit will be applied per partition when processing the partitions independently (default). The default limit is 2.

public MqttClientConfigurationBuilder LimitBackpressure(int backpressureLimit)

Parameters

backpressureLimit int

The maximum number of messages to be enqueued.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

LimitPacketSize(long)

Sets the maximum packet size in byte the client will process. The default is no limit.

public MqttClientConfigurationBuilder LimitPacketSize(long maximumPacketSize)

Parameters

maximumPacketSize long

The maximum packet size.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

LimitTopicAlias(int)

Sets the maximum number of topic aliases the server can send in the PUBLISH packet. The default is 0, meaning that no alias can be sent.

public MqttClientConfigurationBuilder LimitTopicAlias(int topicAliasMaximum)

Parameters

topicAliasMaximum int

The maximum number of topic aliases.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

LimitUnacknowledgedPublications(int)

Sets the maximum number of QoS 1 and QoS 2 publications that can be received and processed concurrently. The default value is null, that means 65'535.

public MqttClientConfigurationBuilder LimitUnacknowledgedPublications(int receiveMaximum)

Parameters

receiveMaximum int

The maximum number of concurrent publications.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Remarks

There is no mechanism to limit the QoS 0 publications that the Server might try to send.

Produce(Action<MqttProducerEndpointConfigurationBuilder<object>>)

Adds a producer endpoint, which is a topic and its related configuration (serializer, etc.).

public MqttClientConfigurationBuilder Produce(Action<MqttProducerEndpointConfigurationBuilder<object>> configurationBuilderAction)

Parameters

configurationBuilderAction Action<MqttProducerEndpointConfigurationBuilder<object>>

An Action that takes the MqttClientConfigurationBuilder and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Produce(string?, Action<MqttProducerEndpointConfigurationBuilder<object>>)

Adds a producer endpoint, which is a topic and its related configuration (serializer, etc.).

public MqttClientConfigurationBuilder Produce(string? name, Action<MqttProducerEndpointConfigurationBuilder<object>> configurationBuilderAction)

Parameters

name string

The name is used to guarantee that a duplicated configuration is discarded and is also displayed in the logs. By default, the name will be generated concatenating the topic name and the message type.

configurationBuilderAction Action<MqttProducerEndpointConfigurationBuilder<object>>

An Action that takes the MqttClientConfigurationBuilder and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Produce<TMessage>(Action<MqttProducerEndpointConfigurationBuilder<TMessage>>)

Adds a producer endpoint, which is a topic and its related configuration (serializer, etc.).

public MqttClientConfigurationBuilder Produce<TMessage>(Action<MqttProducerEndpointConfigurationBuilder<TMessage>> configurationBuilderAction) where TMessage : class

Parameters

configurationBuilderAction Action<MqttProducerEndpointConfigurationBuilder<TMessage>>

An Action that takes the MqttClientConfigurationBuilder and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Type Parameters

TMessage

The type (or base type) of the messages being produced. This is used to setup the serializer and will determine the type of the message parameter in the nested configuration functions.

Produce<TMessage>(string?, Action<MqttProducerEndpointConfigurationBuilder<TMessage>>)

Adds a producer endpoint, which is a topic and its related configuration (serializer, etc.).

public MqttClientConfigurationBuilder Produce<TMessage>(string? name, Action<MqttProducerEndpointConfigurationBuilder<TMessage>> configurationBuilderAction) where TMessage : class

Parameters

name string

The name is used to guarantee that a duplicated configuration is discarded and is also displayed in the logs. By default the name will be generated concatenating the topic name and the message type.

configurationBuilderAction Action<MqttProducerEndpointConfigurationBuilder<TMessage>>

An Action that takes the MqttClientConfigurationBuilder and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Type Parameters

TMessage

The type (or base type) of the messages being produced. This is used to setup the serializer and will determine the type of the message parameter in the nested configuration functions.

RequestCleanSession()

Specifies that a clean non-persistent session has to be created for this client. This is the default, use RequestPersistentSession(TimeSpan) to switch to a persistent session.

public MqttClientConfigurationBuilder RequestCleanSession()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Remarks

Clean session in MQTT versions below 5.0 is the same as clean start in MQTT 5.0. RequestCleanSession() and RequestCleanStart() are the same.

RequestCleanStart()

Specifies that a clean non-persistent session has to be created for this client. This is the default, use RequestPersistentSession(TimeSpan) to switch to a persistent session.

public MqttClientConfigurationBuilder RequestCleanStart()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Remarks

Clean session in MQTT versions below 5.0 is the same as clean start in MQTT 5.0. RequestCleanSession() and RequestCleanStart() are the same.

RequestPersistentSession(TimeSpan)

Specifies that a persistent session has to be created for this client.

public MqttClientConfigurationBuilder RequestPersistentSession(TimeSpan sessionExpiryInterval = default)

Parameters

sessionExpiryInterval TimeSpan

The TimeSpan representing the session expiry interval.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

RequestProblemInformation()

Specifies that the reason string or user properties can be sent with any packet. This is usually the default.

public MqttClientConfigurationBuilder RequestProblemInformation()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

RequestResponseInformation()

Specifies that the server should return the response information in the CONNACK packet.

public MqttClientConfigurationBuilder RequestResponseInformation()

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

SendKeepAlive(TimeSpan)

Sets the maximum period that can elapse without a packet being sent to the message broker. When this period is elapsed a ping packet will be sent to keep the connection alive. The default is 15 seconds.

public MqttClientConfigurationBuilder SendKeepAlive(TimeSpan interval)

Parameters

interval TimeSpan

The maximum period that can elapse without a packet being sent.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

SendLastWillMessage<TLwtMessage>(Action<MqttLastWillMessageConfigurationBuilder<TLwtMessage>>)

Specifies the last will and testament (LWT) message to be sent when the client disconnects ungracefully.

public MqttClientConfigurationBuilder SendLastWillMessage<TLwtMessage>(Action<MqttLastWillMessageConfigurationBuilder<TLwtMessage>> lastWillBuilderAction)

Parameters

lastWillBuilderAction Action<MqttLastWillMessageConfigurationBuilder<TLwtMessage>>

An Action<T> that takes the MqttLastWillMessageConfigurationBuilder<TMessage> and configures it.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Type Parameters

TLwtMessage

The LWT message type.

UseEnhancedAuthenticationHandler(IMqttEnhancedAuthenticationHandler)

Sets the handler to be used to handle the authentication.

public MqttClientConfigurationBuilder UseEnhancedAuthenticationHandler(IMqttEnhancedAuthenticationHandler handler)

Parameters

handler IMqttEnhancedAuthenticationHandler

The MQTTnet.IMqttEnhancedAuthenticationHandler instance to be used.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

UseEnhancedAuthenticationHandler(Type)

Sets the handler to be used to handle the authentication.

public MqttClientConfigurationBuilder UseEnhancedAuthenticationHandler(Type handlerType)

Parameters

handlerType Type

The type of the MQTTnet.IMqttEnhancedAuthenticationHandler to be used. The instance will be resolved via the IServiceProvider.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

UseEnhancedAuthenticationHandler<THandler>()

Sets the handler to be used to handle the authentication.

public MqttClientConfigurationBuilder UseEnhancedAuthenticationHandler<THandler>() where THandler : IMqttEnhancedAuthenticationHandler

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

Type Parameters

THandler

The type of the MQTTnet.IMqttEnhancedAuthenticationHandler to be used. The instance will be resolved via the IServiceProvider.

UseProtocolVersion(MqttProtocolVersion)

Specifies the MQTT protocol version. The default is MQTTnet.Formatter.MqttProtocolVersion.V500.

public MqttClientConfigurationBuilder UseProtocolVersion(MqttProtocolVersion value)

Parameters

value MqttProtocolVersion

The MQTTnet.Formatter.MqttProtocolVersion.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

WithAcknowledgmentTimeout(TimeSpan)

Sets the maximum time to wait for the acknowledgment operation to complete. The default is 30 seconds.

public MqttClientConfigurationBuilder WithAcknowledgmentTimeout(TimeSpan timeout)

Parameters

timeout TimeSpan

The maximum time to wait for the acknowledgment operation to complete.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

WithClientId(string)

Sets the client identifier. The default is Guid.NewGuid().ToString().

public MqttClientConfigurationBuilder WithClientId(string value)

Parameters

value string

The client identifier.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

WithCredentials(IMqttClientCredentialsProvider)

Sets the credential to be used to authenticate with the message broker.

public MqttClientConfigurationBuilder WithCredentials(IMqttClientCredentialsProvider credentialsProvider)

Parameters

credentialsProvider IMqttClientCredentialsProvider

The MQTTnet.IMqttClientCredentialsProvider.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

WithCredentials(string, byte[]?)

Sets the credential to be used to authenticate with the message broker.

public MqttClientConfigurationBuilder WithCredentials(string username, byte[]? password = null)

Parameters

username string

The username.

password byte[]

The user password.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

WithCredentials(string, string?)

Sets the credential to be used to authenticate with the message broker.

public MqttClientConfigurationBuilder WithCredentials(string username, string? password = null)

Parameters

username string

The username.

password string

The user password.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

WithEnhancedAuthentication(string?, byte[]?)

Specifies the authentication method to be used and the associated data.

public MqttClientConfigurationBuilder WithEnhancedAuthentication(string? method, byte[]? data)

Parameters

method string

The authentication method.

data byte[]

The authentication data.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

WithSessionExpiration(TimeSpan)

Sets the session expiry interval. When set to 0 the session will expire when the connection is closed, while MaxValue indicates that the session will never expire. The default is 0.

public MqttClientConfigurationBuilder WithSessionExpiration(TimeSpan sessionExpiryInterval)

Parameters

sessionExpiryInterval TimeSpan

The TimeSpan representing the session expiry interval.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.

WithTimeout(TimeSpan)

Sets the timeout which will be applied at socket level and internal operations. The default value is the same as for sockets in .NET in general.

public MqttClientConfigurationBuilder WithTimeout(TimeSpan value)

Parameters

value TimeSpan

The TimeSpan representing the timeout.

Returns

MqttClientConfigurationBuilder

The MqttClientConfigurationBuilder so that additional calls can be chained.