From 02e91e727c3cdf843d0a83935e8a290730472569 Mon Sep 17 00:00:00 2001 From: lxw Date: Wed, 12 Jun 2024 17:26:28 +0800 Subject: [PATCH] Tbox Session --- Service/Car/Handler/ElecMsgHandler.cs | 2 +- Service/Car/Handler/HeartBeatMsgHandler.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Service/Car/Handler/ElecMsgHandler.cs b/Service/Car/Handler/ElecMsgHandler.cs index b3741e2..8840539 100644 --- a/Service/Car/Handler/ElecMsgHandler.cs +++ b/Service/Car/Handler/ElecMsgHandler.cs @@ -26,7 +26,7 @@ public class ElecMsgHandler : SimpleChannelInboundHandler, IBaseHandler protected override void ChannelRead0(IChannelHandlerContext ctx, ElecMsg msg) { Log.Info($"receive ElecMsg = {JsonConvert.SerializeObject(msg)}"); - IoSession? ioSession = SessionMgr.GetSession(msg.CarNo); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(msg.CarNo); ioSession?.BusinessMap.AddOrUpdate("ElecMsg", msg, ((s, o) => msg)); ioSession?.BusinessMap.AddOrUpdate("Connected", true, ((s, o) => true)); diff --git a/Service/Car/Handler/HeartBeatMsgHandler.cs b/Service/Car/Handler/HeartBeatMsgHandler.cs index 1bcdb63..8032951 100644 --- a/Service/Car/Handler/HeartBeatMsgHandler.cs +++ b/Service/Car/Handler/HeartBeatMsgHandler.cs @@ -28,7 +28,7 @@ public class HeartBeatMsgHandler : SimpleChannelInboundHandler, IB { Log.Info($"receive HeartBeatMsg = {JsonConvert.SerializeObject(msg)}"); - IoSession? ioSession = SessionMgr.GetSession(ctx.Channel.Id.ToString()); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(ctx.Channel.Id.ToString()); if (ioSession != null && ioSession.Key != msg.CarNo) { CarServerMgr.CarServer?.SessionMgr.ChangeSessionKey(ioSession, msg.CarNo);