mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 19:58:57 +08:00
Merge pull request #884 from chkr1011/feature-isconnected
Added check if the server is started or not.
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
* [Server] Added interceptor for unsubscriptions.
|
* [Server] Added interceptor for unsubscriptions.
|
||||||
* [Server] Removed exceptions when user properties are set with MQTT protocol version 3.1
|
* [Server] Removed exceptions when user properties are set with MQTT protocol version 3.1
|
||||||
* [Server] Added custom session items to the client status.
|
* [Server] Added custom session items to the client status.
|
||||||
|
* [Server] Added option to check whether the server is already started properly or not.
|
||||||
* [MQTTnet.AspNetCore] improved compatibility with AspNetCore 3.1
|
* [MQTTnet.AspNetCore] improved compatibility with AspNetCore 3.1
|
||||||
* [MQTTnet.Server] Added interceptor for unsubscriptions.
|
* [MQTTnet.Server] Added interceptor for unsubscriptions.
|
||||||
</releaseNotes>
|
</releaseNotes>
|
||||||
|
|||||||
@@ -27,5 +27,7 @@ namespace MQTTnet.Server
|
|||||||
|
|
||||||
Task StartAsync(IMqttServerOptions options);
|
Task StartAsync(IMqttServerOptions options);
|
||||||
Task StopAsync();
|
Task StopAsync();
|
||||||
|
|
||||||
|
bool IsStarted { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -190,6 +190,8 @@ namespace MQTTnet.Server
|
|||||||
return _retainedMessagesManager?.ClearMessagesAsync();
|
return _retainedMessagesManager?.ClearMessagesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsStarted => _cancellationTokenSource != null;
|
||||||
|
|
||||||
private Task OnHandleClient(IMqttChannelAdapter channelAdapter)
|
private Task OnHandleClient(IMqttChannelAdapter channelAdapter)
|
||||||
{
|
{
|
||||||
return _clientSessionsManager.HandleClientConnectionAsync(channelAdapter);
|
return _clientSessionsManager.HandleClientConnectionAsync(channelAdapter);
|
||||||
|
|||||||
Reference in New Issue
Block a user