MQTTnet Gets the authentication result. Hint: MQTT 5 feature only. Gets the result code. MQTTv5 only. Gets a value indicating whether a session was already available or not. MQTTv5 only. Gets a value indicating whether wildcards can be used in subscriptions at the current server. MQTTv5 only. Gets whether the server supports retained messages. MQTTv5 only. Gets the client identifier which was chosen by the server. MQTTv5 only. Gets the authentication method. MQTTv5 only. Gets the authentication data. MQTTv5 only. Gets the reason string. MQTTv5 only. Gets the maximum QoS which is supported by the server. MQTTv5 only. Gets the response information. MQTTv5 only. Gets the maximum value for a topic alias. 0 means not supported. MQTTv5 only. Gets an alternate server which should be used instead of the current one. MQTTv5 only. MQTTv5 only. Gets the keep alive interval which was chosen by the server instead of the keep alive interval from the client CONNECT packet. A value of 0 indicates that the feature is not used. Gets a value indicating whether the subscription identifiers are available or not. MQTTv5 only. Gets a value indicating whether the shared subscriptions are available or not. MQTTv5 only. Gets 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. MQTTv5 only. Gets the authentication result. Hint: MQTT 5 feature only. Gets or sets the reason. Hint: MQTT 5 feature only. Gets or sets the reason code. Hint: MQTT 5 feature only. Gets or sets the reason string. Hint: MQTT 5 feature only. Gets the reason code. Hint: MQTT 5 feature only. Gets the reason string. Hint: MQTT 5 feature only. Gets the authentication method. Hint: MQTT 5 feature only. Gets the authentication data. Hint: MQTT 5 feature only. Gets 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. Hint: MQTT 5 feature only. Gets or sets the reason code. Hint: MQTT 5 feature only. Gets or sets the reason string. Hint: MQTT 5 feature only. Gets or sets the authentication data. Authentication data is binary information used to transmit multiple iterations of cryptographic secrets of protocol steps. The content of the authentication data is highly dependent on the specific implementation of the authentication method. Hint: MQTT 5 feature only. 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. Hint: MQTT 5 feature only. Gets or sets the authentication data. Hint: MQTT 5 feature only. Gets or sets the authentication method. Hint: MQTT 5 feature only. 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. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. 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. Gets or sets the receive maximum. This gives the maximum length of the receive messages. Gets or sets the request problem information. Hint: MQTT 5 feature only. Gets or sets the request response information. Hint: MQTT 5 feature only. Gets or sets the session expiry interval. The time after a session expires when it's not actively used. 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. Gets or sets the topic alias maximum. This gives the maximum length of the topic alias. 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. Not all brokers support this feature so it may be necessary to set it to false if your bridge does not connect properly. 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. Hint: MQTT 5 feature only. Gets or sets the content type of the will message. Gets or sets the correlation data of the will message. Gets or sets the will delay interval. This is the time between the client disconnect and the time the will message will be sent. Gets or sets the message expiry interval of the will message. Gets or sets the payload of the will message. Gets or sets the payload format indicator of the will message. Gets or sets the QoS level of the will message. Gets or sets the response topic of the will message. Gets or sets the retain flag of the will message. Gets or sets the topic of the will message. Gets or sets the user properties of the will message. 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. 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. 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. 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. Not all brokers support this feature so it may be necessary to set it to false if your bridge does not connect properly. Gets the local endpoint (network card) which is used by the client. Set it to _null_ to let the OS select the network card. Gets or sets whether the underlying socket should run in dual mode. Leaving this _null_ will avoid setting this value at socket level. Setting this a value other than _null_ will throw an exception when only IPv4 is supported on the machine. Gets the packet identifier which was used for this publish. Gets or sets the reason code. Hint: MQTT 5 feature only. Gets or sets the reason string. Hint: MQTT 5 feature only. 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. Hint: MQTT 5 feature only. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets or sets the reason code which will be sent to the server. Gets or sets the user properties which will be sent to the server in the ACK packet etc. Gets or sets the reason string which will be sent to the server in the ACK packet. Gets or sets whether this message was handled. This value can be used in user code for custom control flow. Gets or sets whether the library should send MQTT ACK packets automatically if required. Gets the indentifier of MQTT packet Gets or sets a list of topic filters the client wants to subscribe to. Topic filters can include regular topics or wild cards. Gets or sets the subscription identifier. The client can specify a subscription identifier when subscribing. The broker will establish and store the mapping relationship between this subscription and subscription identifier when successfully create or modify subscription. The broker will return the subscription identifier associated with this PUBLISH packet and the PUBLISH packet to the client when need to forward PUBLISH packets matching this subscription to this client. Hint: MQTT 5 feature only. 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. Hint: MQTT 5 feature only. Adds the user property to the subscribe options. Hint: MQTT 5 feature only. The property name. The property value. A new instance of the class. Gets the user properties which were part of the SUBACK packet. MQTTv5 only. Gets the reason string. MQTTv5 only. Gets the packet identifier which was used. Gets or sets the topic filter. The topic filter can contain topics and wildcards. Gets or sets the result code. Hint: MQTT 5 feature only. Gets or sets a list of topic filters the client wants to unsubscribe from. Topic filters can include regular topics or wild cards. 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. Hint: MQTT 5 feature only. Adds the user property to the unsubscribe options. Hint: MQTT 5 feature only. The property name. The property value. A new instance of the class. Adds the user property to the unsubscribe options. Hint: MQTT 5 feature only. The user property. A new instance of the class. Gets the user properties which were part of the UNSUBACK packet. MQTTv5 only. Gets the reason string. MQTTv5 only. Gets the packet identifier which was used. Gets or sets the topic filter. The topic filter can contain topics and wildcards. Gets or sets the result code. Hint: MQTT 5 feature only. This logger fires an event when a new message was published. This logger does nothing with the messages. This is a custom implementation of a memory stream which provides only MQTTnet relevant features. The goal is to avoid lots of argument checks like in the original stream. The growth rule is the same as for the original MemoryStream in .net. Also this implementation allows accessing the internal buffer for all platforms and .net framework versions (which is not available at the regular MemoryStream). Gets or sets the content type. The content type must be a UTF-8 encoded string. The content type value identifies the kind of UTF-8 encoded payload. Gets or sets the correlation data. In order for the sender to know what sent message the response refers to it can also send correlation data with the published message. Hint: MQTT 5 feature only. If the DUP flag is set to 0, it indicates that this is the first occasion that the Client or Server has attempted to send this MQTT PUBLISH Packet. If the DUP flag is set to 1, it indicates that this might be re-delivery of an earlier attempt to send the Packet. The DUP flag MUST be set to 1 by the Client or Server when it attempts to re-deliver a PUBLISH Packet [MQTT-3.3.1.-1]. The DUP flag MUST be set to 0 for all QoS 0 messages [MQTT-3.3.1-2]. Gets or sets the message expiry interval. A client can set the message expiry interval in seconds for each PUBLISH message individually. This interval defines the period of time that the broker stores the PUBLISH message for any matching subscribers that are not currently connected. When no message expiry interval is set, the broker must store the message for matching subscribers indefinitely. When the retained=true option is set on the PUBLISH message, this interval also defines how long a message is retained on a topic. Hint: MQTT 5 feature only. Gets or sets the payload. The payload is the data bytes sent via the MQTT protocol. Gets or sets the payload format indicator. The payload format indicator is part of any MQTT packet that can contain a payload. The indicator is an optional byte value. A value of 0 indicates an “unspecified byte stream”. A value of 1 indicates a "UTF-8 encoded payload". If no payload format indicator is provided, the default value is 0. Hint: MQTT 5 feature only. Gets or sets the quality of service level. The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. There are 3 QoS levels in MQTT: - At most once (0): Message gets delivered no time, once or multiple times. - At least once (1): Message gets delivered at least once (one time or more often). - Exactly once (2): Message gets delivered exactly once (It's ensured that the message only comes once). Gets or sets the response topic. In MQTT 5 the ability to publish a response topic was added in the publish message which allows you to implement the request/response pattern between clients that is common in web applications. Hint: MQTT 5 feature only. Gets or sets a value indicating whether the message should be retained or not. A retained message is a normal MQTT message with the retained flag set to true. The broker stores the last retained message and the corresponding QoS for that topic. Gets or sets the subscription identifiers. The client can specify a subscription identifier when subscribing. The broker will establish and store the mapping relationship between this subscription and subscription identifier when successfully create or modify subscription. The broker will return the subscription identifier associated with this PUBLISH packet and the PUBLISH packet to the client when need to forward PUBLISH packets matching this subscription to this client. Hint: MQTT 5 feature only. Gets or sets the MQTT topic. In MQTT, the word topic refers to an UTF-8 string that the broker uses to filter messages for each connected client. The topic consists of one or more topic levels. Each topic level is separated by a forward slash (topic level separator). Gets or sets the topic alias. Topic aliases were introduced are a mechanism for reducing the size of published packets by reducing the size of the topic field. A value of 0 indicates no topic alias is used. Hint: MQTT 5 feature only. 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. Hint: MQTT 5 feature only. Adds the content type to the message. Hint: MQTT 5 feature only. A new instance of the class. Adds the correlation data to the message. Hint: MQTT 5 feature only. The correlation data. A new instance of the class. Adds the message expiry interval in seconds to the message. Hint: MQTT 5 feature only. The message expiry interval. A new instance of the class. Adds the payload format indicator to the message. Hint: MQTT 5 feature only. The payload format indicator. A new instance of the class. The quality of service level. The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. There are 3 QoS levels in MQTT: - At most once (0): Message gets delivered no time, once or multiple times. - At least once (1): Message gets delivered at least once (one time or more often). - Exactly once (2): Message gets delivered exactly once (It's ensured that the message only comes once). Adds the response topic to the message. Hint: MQTT 5 feature only. The response topic. A new instance of the class. A value indicating whether the message should be retained or not. A retained message is a normal MQTT message with the retained flag set to true. The broker stores the last retained message and the corresponding QoS for that topic. Adds the subscription identifier to the message. Hint: MQTT 5 feature only. The subscription identifier. A new instance of the class. The MQTT topic. In MQTT, the word topic refers to an UTF-8 string that the broker uses to filter messages for each connected client. The topic consists of one or more topic levels. Each topic level is separated by a forward slash (topic level separator). Adds the topic alias to the message. Hint: MQTT 5 feature only. The topic alias. A new instance of the class. Adds the user property to the message. Hint: MQTT 5 feature only. The property name. The property value. A new instance of the class. The quality of service level. The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. There are 3 QoS levels in MQTT: - At most once (0): Message gets delivered no time, once or multiple times. - At least once (1): Message gets delivered at least once (one time or more often). - Exactly once (2): Message gets delivered exactly once (It's ensured that the message only comes once). The MQTT topic. In MQTT, the word topic refers to an UTF-8 string that the broker uses to filter messages for each connected client. The topic consists of one or more topic levels. Each topic level is separated by a forward slash (topic level separator). Added in MQTTv5.0.0. Added in MQTTv5. Added in MQTTv3.1.1. Added in MQTTv5. Also called "Clean Start" in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Reason Code is used in MQTTv5.0.0 and backward compatible to v.3.1.1. Return Code is used in MQTTv3.1.1 Added in MQTTv5. Added in MQTTv5. It is a Protocol Error if the Subscription Identifier has a value of 0. Added in MQTTv5. Gets or sets a value indicating whether the sender will not receive its own published application messages. Hint: MQTT 5 feature only. Gets or sets the quality of service level. The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. There are 3 QoS levels in MQTT: - At most once (0): Message gets delivered no time, once or multiple times. - At least once (1): Message gets delivered at least once (one time or more often). - Exactly once (2): Message gets delivered exactly once (It's ensured that the message only comes once). Gets or sets a value indicating whether messages are retained as published or not. Hint: MQTT 5 feature only. Gets or sets the retain handling. Hint: MQTT 5 feature only. Gets or sets the MQTT topic. In MQTT, the word topic refers to an UTF-8 string that the broker uses to filter messages for each connected client. The topic consists of one or more topic levels. Each topic level is separated by a forward slash (topic level separator). Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Added in MQTTv5. Gets the application message which was not consumed by any client. Gets the ID of the client which has sent the affected application message. Gets the packet which was used for acknowledge. This can be a PubAck or PubComp packet. Gets the ID of the client which acknowledged a PUBLISH packet. Gets whether the PUBLISH packet is fully acknowledged. This is the case for PUBACK (QoS 1) and PUBCOMP (QoS 2. Gets the PUBLISH packet which was acknowledged. Gets the session items which contain custom user data per session. Gets the client identifier of the connected client. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets the endpoint of the connected client. Gets the protocol version which is used by the connected client. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets the user name of the connected client. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets the topic filter. The topic filter can contain topics and wildcards. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets or sets the topic filter. The topic filter can contain topics and wildcards. Gets the cancellation token from the connection managing thread. Use this in further event processing. Gets the client ID which has sent the packet or will receive the packet. Gets the endpoint of the sending or receiving client. Gets or sets the MQTT packet which was received or will be sent. Gets or sets whether the packet should be processed or not. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets the cancellation token which can indicate that the client connection gets down. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets or sets whether the publish should be processed internally. Gets the response which will be sent to the client via the PUBACK etc. packets. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets the cancellation token which can indicate that the client connection gets down. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets or sets whether the broker should close the client connection. Gets or sets whether the broker should create an internal subscription for the client. The broker can also avoid this and return "success" to the client. This feature allows using the MQTT Broker as the Frontend and another system as the backend. Gets or sets the reason string which will be sent to the client in the SUBACK packet. Gets the response which will be sent to the client via the SUBACK packet. Gets the current client session. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets or sets the topic filter. The topic filter can contain topics and wildcards. Gets or sets the user properties. Gets the cancellation token which can indicate that the client connection gets down. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets or sets whether the broker should close the client connection. Gets or sets whether the broker should remove an internal subscription for the client. The broker can also avoid this and return "success" to the client. This feature allows using the MQTT Broker as the Frontend and another system as the backend. Gets the response which will be sent to the client via the UNSUBACK pocket. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets or sets the MQTT topic. In MQTT, the word topic refers to an UTF-8 string that the broker uses to filter messages for each connected client. The topic consists of one or more topic levels. Each topic level is separated by a forward slash (topic level separator). Gets the will delay interval. This is the time between the client disconnect and the time the will message will be sent. Gets the ID of the session. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets or sets the assigned client identifier. MQTTv5 only. Gets or sets the authentication data. Hint: MQTT 5 feature only. Gets or sets the authentication method. Hint: MQTT 5 feature only. Gets the channel adapter. This can be a _MqttConnectionContext_ (used in ASP.NET), a _MqttChannelAdapter_ (used for TCP or WebSockets) or a custom implementation. 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. Gets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. 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. A value of 0 indicates that the value is not used. Gets or sets the reason code. When a MQTTv3 client connects the enum value must be one which is also supported in MQTTv3. Otherwise the connection attempt will fail because not all codes can be converted properly. MQTTv5 only. Gets or sets the receive maximum. This gives the maximum length of the receive messages. A value of 0 indicates that the value is not used. Gets the request problem information. Hint: MQTT 5 feature only. Gets the request response information. Hint: MQTT 5 feature only. Gets or sets the response authentication data. MQTTv5 only. Gets or sets the response 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. Hint: MQTT 5 feature only. Gets or sets the server reference. This can be used together with i.e. "Server Moved" to send a different server address to the client. MQTTv5 only. Gets the session expiry interval. The time after a session expires when it's not actively used. A value of 0 means no expiation. Gets or sets a key/value collection that can be used to share data within the scope of this session. Gets or sets the topic alias maximum. This gives the maximum length of the topic alias. A value of 0 indicates that the value is not used. 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. Hint: MQTT 5 feature only. Gets or sets the will delay interval. This is the time between the client disconnect and the time the will message will be sent. A value of 0 indicates that the value is not used. Timestamp of the last package that has been sent to the client ("received" from the client's perspective) Timestamp of the last package that has been received from the client ("sent" from the client's perspective) Session should persist if CleanSession was set to false (Mqtt3) or if SessionExpiryInterval != 0 (Mqtt5) Helper class that stores the topic hash mask common to all contained Subscriptions for direct access. 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. 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. This requires admin permissions on Linux. Gets or sets the client identifier. Hint: This identifier needs to be unique over all used clients / devices on the broker to avoid connection issues. Gets or sets the reason code which is sent to the client. The subscription is skipped when the value is not GrantedQoS_. MQTTv5 only. Gets or sets the reason code which is sent to the client. MQTTv5 only.