Exemple #1
0
        // 这个channelId是由CreateConnectChannelId生成的
        public static Session Create(this NetInnerComponent self, IPEndPoint ipEndPoint)
        {
            uint    localConn = self.Service.CreateRandomLocalConn();
            long    channelId = self.Service.CreateConnectChannelId(localConn);
            Session session   = self.CreateInner(channelId, ipEndPoint);

            return(session);
        }
Exemple #2
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);
        }