From 87c4fa14ee7f5722114f32c524c96e925cb0a2fd Mon Sep 17 00:00:00 2001 From: SeppPenner Date: Sun, 29 Mar 2020 16:48:19 +0200 Subject: [PATCH] Added check if the server is started or not. --- Source/MQTTnet/Server/MqttServer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/MQTTnet/Server/MqttServer.cs b/Source/MQTTnet/Server/MqttServer.cs index 4c5ab62..a76e658 100644 --- a/Source/MQTTnet/Server/MqttServer.cs +++ b/Source/MQTTnet/Server/MqttServer.cs @@ -190,6 +190,8 @@ namespace MQTTnet.Server return _retainedMessagesManager?.ClearMessagesAsync(); } + public bool IsStarted => _cancellationTokenSource != null; + private Task OnHandleClient(IMqttChannelAdapter channelAdapter) { return _clientSessionsManager.HandleClientAsync(channelAdapter);