Class MqttWill
A message the broker publishes on the client's behalf if its connection ends without a disconnect: the network dropped, the power failed, or the keep-alive ran out.
public sealed record MqttWill : IEquatable<MqttWill>
- Inheritance
-
MqttWill
- Implements
- Inherited Members
Remarks
A client that calls DisconnectAsync() leaves no will behind.
Constructors
MqttWill(string, ReadOnlyMemory<byte>)
A message the broker publishes on the client's behalf if its connection ends without a disconnect: the network dropped, the power failed, or the keep-alive ran out.
public MqttWill(string Topic, ReadOnlyMemory<byte> Payload)
Parameters
TopicstringThe topic the broker publishes it to, with no wildcard.
PayloadReadOnlyMemory<byte>What it publishes.
Remarks
A client that calls DisconnectAsync() leaves no will behind.
MqttWill(string, string)
Creates a will whose payload is text, encoded as UTF-8.
public MqttWill(string topic, string payload)
Parameters
Properties
Payload
What it publishes.
public ReadOnlyMemory<byte> Payload { get; init; }
Property Value
Qos
The quality of service it is published at.
public Qos Qos { get; init; }
Property Value
Retain
Whether the broker retains it for clients that subscribe later.
public bool Retain { get; init; }
Property Value
Topic
The topic the broker publishes it to, with no wildcard.
public string Topic { get; init; }