Use event pattern correctly for incoming server connections.

This commit is contained in:
Christian Kratky
2017-10-17 20:05:04 +02:00
parent ad4585989a
commit 9915cc4492
10 changed files with 44 additions and 34 deletions
@@ -8,7 +8,7 @@ namespace MQTTnet.Core.Tests
{
public class TestMqttServerAdapter : IMqttServerAdapter
{
public event Action<IMqttCommunicationAdapter> ClientAccepted;
public event EventHandler<MqttServerAdapterClientAcceptedEventArgs> ClientAccepted;
public async Task<MqttClient> ConnectTestClient(IMqttServer server, string clientId, MqttApplicationMessage willMessage = null)
{
@@ -47,7 +47,7 @@ namespace MQTTnet.Core.Tests
private void FireClientAcceptedEvent(IMqttCommunicationAdapter adapter)
{
ClientAccepted?.Invoke(adapter);
ClientAccepted?.Invoke(this, new MqttServerAdapterClientAcceptedEventArgs(adapter));
}
public Task StartAsync(MqttServerOptions options)