mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-25 07:41:32 +08:00
improved api surface of mqttserver and fixed unittests
This commit is contained in:
@@ -27,7 +27,7 @@ namespace MQTTnet.Core.Server
|
||||
_clientSessionsManager.ClientDisconnected += OnClientDisconnected;
|
||||
}
|
||||
|
||||
public IList<ConnectedMqttClient> GetConnectedClients()
|
||||
public IReadOnlyList<ConnectedMqttClient> GetConnectedClients()
|
||||
{
|
||||
return _clientSessionsManager.GetConnectedClients();
|
||||
}
|
||||
@@ -43,14 +43,6 @@ namespace MQTTnet.Core.Server
|
||||
_clientSessionsManager.DispatchPublishPacket(null, applicationMessage.ToPublishPacket());
|
||||
}
|
||||
|
||||
public void InjectClient(IMqttCommunicationAdapter adapter)
|
||||
{
|
||||
if (adapter == null) throw new ArgumentNullException(nameof(adapter));
|
||||
if (_cancellationTokenSource == null) throw new InvalidOperationException("The MQTT server is not started.");
|
||||
|
||||
OnClientAccepted(adapter);
|
||||
}
|
||||
|
||||
public async Task StartAsync()
|
||||
{
|
||||
if (_cancellationTokenSource != null) throw new InvalidOperationException("The MQTT server is already started.");
|
||||
|
||||
Reference in New Issue
Block a user