示例#1
0
        public void OnAccept(AChannel channel)
        {
            Session session = ObjectFactory.CreateEntity <Session>();

            session.Awake(this, channel);
            this.sessions.Add(session.InstanceId, session);
        }
示例#2
0
        /// <summary>
        /// 创建一个新Session
        /// </summary>
        public Session Create(IPEndPoint ipEndPoint)
        {
            AChannel channel = this.Service.ConnectChannel(ipEndPoint);
            Session  session = ObjectFactory.CreateEntity <Session>();

            session.Awake(this, channel);
            this.sessions.Add(session.InstanceId, session);
            return(session);
        }