Browse Source

Refactor events.

release/3.x.x
Christian 6 years ago
parent
commit
2499d29196
4 changed files with 18 additions and 10 deletions
  1. +2
    -1
      Frameworks/MQTTnet.NetStandard/Server/IMqttServer.cs
  2. +2
    -1
      Frameworks/MQTTnet.NetStandard/Server/MqttServer.cs
  3. +14
    -0
      Frameworks/MQTTnet.NetStandard/Server/MqttServerEventDispatcher.cs
  4. +0
    -8
      Frameworks/MQTTnet.NetStandard/Server/MqttServerStartedEventArgs.cs

+ 2
- 1
Frameworks/MQTTnet.NetStandard/Server/IMqttServer.cs View File

@@ -6,7 +6,8 @@ namespace MQTTnet.Server
{
public interface IMqttServer : IApplicationMessageReceiver, IApplicationMessagePublisher
{
event EventHandler<MqttServerStartedEventArgs> Started;
event EventHandler Started;
event EventHandler Stopped;

event EventHandler<MqttClientConnectedEventArgs> ClientConnected;
event EventHandler<MqttClientDisconnectedEventArgs> ClientDisconnected;


+ 2
- 1
Frameworks/MQTTnet.NetStandard/Server/MqttServer.cs View File

@@ -26,7 +26,8 @@ namespace MQTTnet.Server
_adapters = adapters.ToList();
}

public event EventHandler<MqttServerStartedEventArgs> Started;
public event EventHandler Started;
public event EventHandler Stopped;

public event EventHandler<MqttClientConnectedEventArgs> ClientConnected;
public event EventHandler<MqttClientDisconnectedEventArgs> ClientDisconnected;


+ 14
- 0
Frameworks/MQTTnet.NetStandard/Server/MqttServerEventDispatcher.cs View File

@@ -0,0 +1,14 @@
using System;

namespace MQTTnet.Server
{
public class MqttServerEventDispatcher
{
public event EventHandler<MqttClientConnectedEventArgs> ClientConnected;
public event EventHandler<MqttClientDisconnectedEventArgs> ClientDisconnected;
public event EventHandler<MqttClientSubscribedTopicEventArgs> ClientSubscribedTopic;
public event EventHandler<MqttClientUnsubscribedTopicEventArgs> ClientUnsubscribedTopic;

public event EventHandler<MqttApplicationMessageReceivedEventArgs> ApplicationMessageReceived;
}
}

+ 0
- 8
Frameworks/MQTTnet.NetStandard/Server/MqttServerStartedEventArgs.cs View File

@@ -1,8 +0,0 @@
using System;

namespace MQTTnet.Server
{
public class MqttServerStartedEventArgs : EventArgs
{
}
}

Loading…
Cancel
Save