예제 #1
0
        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);
        }
예제 #2
0
        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();
        }
예제 #3
0
        // 内网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);
        }