Add an event to receive all application messages at server level.

This commit is contained in:
Christian Kratky
2017-07-13 20:28:49 +02:00
parent 2ff449b241
commit 98d7bc980c
10 changed files with 110 additions and 14 deletions
+3
View File
@@ -21,6 +21,7 @@ namespace MQTTnet.Core.Server
_adapters = adapters ?? throw new ArgumentNullException(nameof(adapters));
_clientSessionsManager = new MqttClientSessionsManager(options);
_clientSessionsManager.ApplicationMessageReceived += (s, e) => ApplicationMessageReceived?.Invoke(s, e);
}
public IList<string> GetConnectedClients()
@@ -30,6 +31,8 @@ namespace MQTTnet.Core.Server
public event EventHandler<MqttClientConnectedEventArgs> ClientConnected;
public event EventHandler<MqttApplicationMessageReceivedEventArgs> ApplicationMessageReceived;
public void InjectClient(string identifier, IMqttCommunicationAdapter adapter)
{
if (adapter == null) throw new ArgumentNullException(nameof(adapter));