mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 03:24:33 +08:00
improved server usage in aspnet so no exceptions are thrown on startup
This commit is contained in:
@@ -49,6 +49,7 @@ namespace MQTTnet.Core.Server
|
||||
return _clientSessionsManager.GetConnectedClients();
|
||||
}
|
||||
|
||||
public event EventHandler<MqttServerStartedEventArgs> Started;
|
||||
public event EventHandler<MqttClientConnectedEventArgs> ClientConnected;
|
||||
public event EventHandler<MqttClientDisconnectedEventArgs> ClientDisconnected;
|
||||
public event EventHandler<MqttApplicationMessageReceivedEventArgs> ApplicationMessageReceived;
|
||||
@@ -96,6 +97,8 @@ namespace MQTTnet.Core.Server
|
||||
}
|
||||
|
||||
_logger.LogInformation("Started.");
|
||||
|
||||
Started?.Invoke(this, new MqttServerStartedEventArgs());
|
||||
}
|
||||
|
||||
public async Task StopAsync()
|
||||
|
||||
Reference in New Issue
Block a user