diff --git a/Source/MQTTnet.Extensions.ManagedClient/ManagedProcessFailedEventArgs.cs b/Source/MQTTnet.Extensions.ManagedClient/ManagedProcessFailedEventArgs.cs new file mode 100644 index 0000000..bb0cf68 --- /dev/null +++ b/Source/MQTTnet.Extensions.ManagedClient/ManagedProcessFailedEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace MQTTnet.Extensions.ManagedClient +{ + public class ManagedProcessFailedEventArgs : EventArgs + { + public ManagedProcessFailedEventArgs(Exception exception) + { + Exception = exception ?? throw new ArgumentNullException(nameof(exception)); + } + + public Exception Exception { get; } + } +} \ No newline at end of file diff --git a/Source/MQTTnet/Server/MqttServer.cs b/Source/MQTTnet/Server/MqttServer.cs index 918cfb6..b9cb613 100644 --- a/Source/MQTTnet/Server/MqttServer.cs +++ b/Source/MQTTnet/Server/MqttServer.cs @@ -146,7 +146,7 @@ namespace MQTTnet.Server return; } - _clientSessionsManager.Stop(); + await _clientSessionsManager.StopAsync().ConfigureAwait(false); _cancellationTokenSource.Cancel(false);