public void OnAccept(AChannel channel) { Session session = ObjectFactory.CreateEntity <Session>(); session.Awake(this, channel); this.sessions.Add(session.InstanceId, session); }
/// <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); }