Table of Contents

Class MqttWill

Namespace
Pamoja.Mqtt
Assembly
Pamoja.Mqtt.dll

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

Topic string

The topic the broker publishes it to, with no wildcard.

Payload ReadOnlyMemory<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

topic string

The topic the broker publishes it to.

payload string

What it publishes.

Properties

Payload

What it publishes.

public ReadOnlyMemory<byte> Payload { get; init; }

Property Value

ReadOnlyMemory<byte>

Qos

The quality of service it is published at.

public Qos Qos { get; init; }

Property Value

Qos

Retain

Whether the broker retains it for clients that subscribe later.

public bool Retain { get; init; }

Property Value

bool

Topic

The topic the broker publishes it to, with no wildcard.

public string Topic { get; init; }

Property Value

string