Class MqttClientOptions
public sealed class MqttClientOptions
- Inheritance
-
MqttClientOptions
- Inherited Members
Constructors
MqttClientOptions()
public MqttClientOptions()
Properties
AllowPacketFragmentation
Usually the MQTT packets can be send partially. This is done by using multiple TCP packets or WebSocket frames etc. Unfortunately not all brokers (like Amazon Web Services (AWS)) do support this feature and will close the connection when receiving such packets. If such a service is used this flag must be set to false.
public bool AllowPacketFragmentation { get; set; }
Property Value
AuthenticationData
Gets or sets the authentication data.
public byte[] AuthenticationData { get; set; }
Property Value
- byte[]
AuthenticationMethod
Gets or sets the authentication method.
public string AuthenticationMethod { get; set; }
Property Value
ChannelOptions
public IMqttClientChannelOptions ChannelOptions { get; set; }
Property Value
CleanSession
Gets or sets a value indicating whether clean sessions are used or not. When a client connects to a broker it can connect using either a non persistent connection (clean session) or a persistent connection. With a non persistent connection the broker doesn't store any subscription information or undelivered messages for the client. This mode is ideal when the client only publishes messages. It can also connect as a durable client using a persistent connection. In this mode, the broker will store subscription information, and undelivered messages for the client.
public bool CleanSession { get; set; }
Property Value
ClientId
Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues.
public string ClientId { get; set; }
Property Value
Credentials
public IMqttClientCredentialsProvider Credentials { get; set; }
Property Value
ExtendedAuthenticationExchangeHandler
public IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; set; }
Property Value
KeepAlivePeriod
Gets or sets the keep alive period. The connection is normally left open by the client so that is can send and receive data at any time. If no data flows over an open connection for a certain time period then the client will generate a PINGREQ and expect to receive a PINGRESP from the broker. This message exchange confirms that the connection is open and working. This period is known as the keep alive period.
public TimeSpan KeepAlivePeriod { get; set; }
Property Value
MaximumPacketSize
Gets or sets the maximum packet size.
public uint MaximumPacketSize { get; set; }
Property Value
ProtocolVersion
public MqttProtocolVersion ProtocolVersion { get; set; }
Property Value
ReceiveMaximum
Gets or sets the receive maximum.
This gives the maximum length of the receive messages.
public ushort ReceiveMaximum { get; set; }
Property Value
RequestProblemInformation
Gets or sets the request problem information.
public bool RequestProblemInformation { get; set; }
Property Value
RequestResponseInformation
Gets or sets the request response information.
public bool RequestResponseInformation { get; set; }
Property Value
SessionExpiryInterval
Gets or sets the session expiry interval.
The time after a session expires when it's not actively used.
public uint SessionExpiryInterval { get; set; }
Property Value
ThrowOnNonSuccessfulConnectResponse
Gets or sets whether an exception should be thrown when the server has sent a non success ACK packet.
public bool ThrowOnNonSuccessfulConnectResponse { get; set; }
Property Value
Timeout
Gets or 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 TimeSpan Timeout { get; set; }
Property Value
TopicAliasMaximum
Gets or sets the topic alias maximum.
This gives the maximum length of the topic alias.
public ushort TopicAliasMaximum { get; set; }
Property Value
TryPrivate
If set to true, the bridge will attempt to indicate to the remote broker that it is a bridge not an ordinary
client.
If successful, this means that loop detection will be more effective and that retained messages will be propagated
correctly.
public bool TryPrivate { get; set; }
Property Value
UserProperties
Gets or sets the user properties.
In MQTT 5, user properties are basic UTF-8 string key-value pairs that you can append to almost every type of MQTT
packet.
As long as you don’t exceed the maximum message size, you can use an unlimited number of user properties to add
metadata to MQTT messages and pass information between publisher, broker, and subscriber.
The feature is very similar to the HTTP header concept.
public List<MqttUserProperty> UserProperties { get; set; }
Property Value
ValidateFeatures
When this feature is enabled the client will check if used properties are supported in the selected protocol version. This feature can be validated if an application message is generated one time but sent via different protocol versions. Default values are applied if the validation is off and features are not supported.
public bool ValidateFeatures { get; set; }
Property Value
WillContentType
Gets or sets the content type of the will message.
public string WillContentType { get; set; }
Property Value
WillCorrelationData
Gets or sets the correlation data of the will message.
public byte[] WillCorrelationData { get; set; }
Property Value
- byte[]
WillDelayInterval
Gets or sets the will delay interval.
This is the time between the client disconnect and the time the will message will be sent.
public uint WillDelayInterval { get; set; }
Property Value
WillMessageExpiryInterval
Gets or sets the message expiry interval of the will message.
public uint WillMessageExpiryInterval { get; set; }
Property Value
WillPayload
Gets or sets the payload of the will message.
public byte[] WillPayload { get; set; }
Property Value
- byte[]
WillPayloadFormatIndicator
Gets or sets the payload format indicator of the will message.
public MqttPayloadFormatIndicator WillPayloadFormatIndicator { get; set; }
Property Value
WillQualityOfServiceLevel
Gets or sets the QoS level of the will message.
public MqttQualityOfServiceLevel WillQualityOfServiceLevel { get; set; }
Property Value
WillResponseTopic
Gets or sets the response topic of the will message.
public string WillResponseTopic { get; set; }
Property Value
WillRetain
Gets or sets the retain flag of the will message.
public bool WillRetain { get; set; }
Property Value
WillTopic
Gets or sets the topic of the will message.
public string WillTopic { get; set; }
Property Value
WillUserProperties
Gets or sets the user properties of the will message.
public List<MqttUserProperty> WillUserProperties { get; set; }
Property Value
WriterBufferSize
Gets or sets the default and initial size of the packet write buffer. It is recommended to set this to a value close to the usual expected packet size * 1.5. Do not change this value when no memory issues are experienced.
public int WriterBufferSize { get; set; }
Property Value
WriterBufferSizeMax
Gets or sets the maximum size of the buffer writer. The writer will reduce its internal buffer to this value after serializing a packet. Do not change this value when no memory issues are experienced.
public int WriterBufferSizeMax { get; set; }