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);