Table of Contents

Class MqttClientPublishResult

Namespace
MQTTnet.Client
Assembly
MQTTnet.dll
public sealed class MqttClientPublishResult
Inheritance
MqttClientPublishResult
Inherited Members

Constructors

MqttClientPublishResult(ushort?, MqttClientPublishReasonCode, string, IReadOnlyCollection<MqttUserProperty>)

public MqttClientPublishResult(ushort? packetIdentifier, MqttClientPublishReasonCode reasonCode, string reasonString, IReadOnlyCollection<MqttUserProperty> userProperties)

Parameters

packetIdentifier ushort?
reasonCode MqttClientPublishReasonCode
reasonString string
userProperties IReadOnlyCollection<MqttUserProperty>

Properties

IsSuccess

Returns if the overall status of the publish is a success. This can be the reason code Success or NoMatchingSubscribers. NoMatchingSubscribers usually indicates only that no other client is interested in the topic but overall transmit to the server etc. was a success.

public bool IsSuccess { get; }

Property Value

bool

PacketIdentifier

Gets the packet identifier which was used for this publish.

public ushort? PacketIdentifier { get; }

Property Value

ushort?

ReasonCode

Gets or sets the reason code. MQTT 5.0.0+ feature.

public MqttClientPublishReasonCode ReasonCode { get; }

Property Value

MqttClientPublishReasonCode

ReasonString

Gets or sets the reason string. MQTT 5.0.0+ feature.

public string ReasonString { get; }

Property Value

string

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. MQTT 5.0.0+ feature.

public IReadOnlyCollection<MqttUserProperty> UserProperties { get; }

Property Value

IReadOnlyCollection<MqttUserProperty>