public static void OnRead(this NetInnerComponent self, long channelId, MemoryStream memoryStream) { Session session = self.GetChild <Session>(channelId); if (session == null) { return; } session.LastRecvTime = TimeHelper.ClientNow(); Game.EventSystem.Callback(self.SessionStreamDispatcherType, session, memoryStream); }
public static void OnError(this NetInnerComponent self, long channelId, int error) { Session session = self.GetChild <Session>(channelId); if (session == null) { return; } session.Error = error; session.Dispose(); }
// 内网actor session,channelId是进程号 public static Session Get(this NetInnerComponent self, long channelId) { Session session = self.GetChild <Session>(channelId); if (session == null) { IPEndPoint ipEndPoint = StartProcessConfigCategory.Instance.Get((int)channelId).InnerIPPort; session = self.CreateInner(channelId, ipEndPoint); } return(session); }