浏览代码

Refactor events.

release/3.x.x
Christian 6 年前
父节点
当前提交
2499d29196
共有 4 个文件被更改,包括 18 次插入10 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

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

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

正在加载...
取消
保存