修改新版协议主机 协议触发的机制,新增 缓存机制

This commit is contained in:
2026-04-09 13:37:09 +08:00
parent c13ab0cb56
commit 36c2fa4061
22 changed files with 484 additions and 1897 deletions

View File

@@ -7,6 +7,7 @@ using Common;
using Domain;
using RCUHost.Protocols;
using CommonEntity;
using System.Net;
namespace RCUHost.Implement
{
@@ -14,11 +15,21 @@ namespace RCUHost.Implement
{
private static log4net.ILog logger = log4net.LogManager.GetLogger(typeof(DeviceControlReceiver));
public void SendWithEndPoint(Device device, IPEndPoint endpoint)
{
SendWithEndPoint(new List<Device> { device }, endpoint);
}
public void SendWithEndPoint(IList<Device> devices, IPEndPoint endpoint)
{
var data = CreateDeviceControlPacket(devices);
SendAndPushCommandQueueWithEndPoint(data, endpoint);// host.IP, host.Port);
}
public void Send(Host host, Device device)
{
Send(host, new List<Device> { device });
}
public void Send(Host host, IList<Device> devices)
{
var data = CreateDeviceControlPacket(devices);
@@ -33,9 +44,9 @@ namespace RCUHost.Implement
//string nnn = builder.ToString().Trim();
//logger.Error(string.Format("给酒店({0})客房({1})发送控制命令{2}", host.SysHotel.Code, host.RoomNumber,builder.ToString()));
}
public void Send_Repeat(string Key,Host host, Device device)
public void Send_Repeat(string Key, Host host, Device device)
{
Send_Repeat(Key,host, new List<Device> { device });
Send_Repeat(Key, host, new List<Device> { device });
}
public void Send_Repeat(string PrefixKey, Host host, IList<Device> devices)
{
@@ -223,5 +234,6 @@ namespace RCUHost.Implement
{
get { return CommandType.DeviceControl; }
}
}
}