mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using MQTTnet.Client.Connecting;
|
|
|
|
namespace MQTTnet.Client.Disconnecting
|
|
{
|
|
public sealed class MqttClientDisconnectedEventArgs : EventArgs
|
|
{
|
|
public MqttClientDisconnectedEventArgs(bool clientWasConnected, Exception exception, MqttClientAuthenticateResult authenticateResult, MqttClientDisconnectReason reason)
|
|
{
|
|
ClientWasConnected = clientWasConnected;
|
|
Exception = exception;
|
|
AuthenticateResult = authenticateResult;
|
|
Reason = reason;
|
|
|
|
ReasonCode = reason;
|
|
}
|
|
|
|
public bool ClientWasConnected { get; }
|
|
|
|
public Exception Exception { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the authentication result.
|
|
/// Hint: MQTT 5 feature only.
|
|
/// </summary>
|
|
public MqttClientAuthenticateResult AuthenticateResult { get; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the reason.
|
|
/// Hint: MQTT 5 feature only.
|
|
/// </summary>
|
|
public MqttClientDisconnectReason Reason { get; set; }
|
|
|
|
[Obsolete("Please use 'Reason' instead. This property will be removed in the future!")]
|
|
public MqttClientDisconnectReason ReasonCode { get; set; }
|
|
}
|
|
}
|