handler中错误修订

master
CZ 5 months ago
parent 7128172d20
commit 681e418798

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class BatteryFourSnHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class BatteryFourSnHandler : SimpleChannelInboundHandler<BatteryFourSn>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(BatteryFourSnHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, BatteryFourSn msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.BatteryFourSn = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class BatteryInfo1Handler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class BatteryInfo1Handler : SimpleChannelInboundHandler< BatteryInfo1>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(BatteryInfo1Handler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, BatteryInfo1 msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.BatteryInfo1 = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class BatteryOneSnHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class BatteryOneSnHandler : SimpleChannelInboundHandler<BatteryOneSn>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(BatteryOneSnHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, BatteryOneSn msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.BatteryOneSn = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class BatteryThreeSnHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class BatteryThreeSnHandler : SimpleChannelInboundHandler<BatteryThreeSn>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(BatteryThreeSnHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, BatteryThreeSn msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.BatteryThreeSn = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class BatteryTwoSnHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class BatteryTwoSnHandler : SimpleChannelInboundHandler<BatteryTwoSn>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(BatteryTwoSnHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, BatteryTwoSn msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.BatteryTwoSn = msg;
}
}

@ -1,18 +1,22 @@
using DotNetty.Transport.Channels;
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.Host;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class LockMsgHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class LockMsgHandler : SimpleChannelInboundHandler<LockMsg>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(LockMsgHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, LockMsg msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.LockMsg = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class LockStatusMsgHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class LockStatusMsgHandler : SimpleChannelInboundHandler<LockStatusMsg>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(LockStatusMsgHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, LockStatusMsg msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.LockStatusMsg = msg;
}
}

@ -1,18 +1,22 @@
using DotNetty.Transport.Channels;
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.Host;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class RestartMsgHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class RestartMsgHandler : SimpleChannelInboundHandler<RestartMsg>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(RestartMsgHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, RestartMsg msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.RestartMsg = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class SohMsgHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class SohMsgHandler : SimpleChannelInboundHandler<SohMsg>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(SohMsgHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, SohMsg msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.SohMsg = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class StatusMsgHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class StatusMsgHandler : SimpleChannelInboundHandler<StatusMsg>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(StatusMsgHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, StatusMsg msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.StatusMsg = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class SubMileMsgHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class SubMileMsgHandler : SimpleChannelInboundHandler<SubMileMsg>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(SubMileMsgHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, SubMileMsg msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.SubMileMsg = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class TotalMileMsgHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class TotalMileMsgHandler : SimpleChannelInboundHandler<TotalMileMsg>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(TotalMileMsgHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, TotalMileMsg msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.TotalMileMsg = msg;
}
}

@ -2,17 +2,20 @@
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.TBox.Msg.TBox;
using Service.TBox.Server;
namespace Service.TBox.Handler;
[Order(8)]
[Scope("InstancePerDependency")]
public class VersionMsgHandler : SimpleChannelInboundHandler<OtherMsg>, IBaseHandler
public class VersionMsgHandler : SimpleChannelInboundHandler<VersionMsg>, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(VersionMsgHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg)
protected override void ChannelRead0(IChannelHandlerContext ctx, VersionMsg msg)
{
Log.Info($"receive OtherMsg={msg}");
var server = TBoxServerMgr.Server;
if (server != null) server.VersionMsg = msg;
}
}

@ -21,7 +21,7 @@ public partial class Form2 : Form
public Form2()
{
InitializeComponent();
this.txtPort.Text = "9000";
this.txtPort.Text = "9999";
Task.Run(() =>
{
while (true)

Loading…
Cancel
Save