コード例 #1
0
ファイル: NetworkComponent.cs プロジェクト: pinzeweifen/DCET
        public virtual Session OnAccept(AChannel channel)
        {
            Session session = EntityFactory.CreateWithParent <Session, AChannel>(this, channel);

            this.Sessions.Add(session.Id, session);
            channel.Start();
            return(session);
        }
コード例 #2
0
ファイル: NetworkComponent.cs プロジェクト: pinzeweifen/DCET
        /// <summary>
        /// 创建一个新Session
        /// </summary>
        public Session Create(string address)
        {
            AChannel channel = this.Service.ConnectChannel(address);
            Session  session = EntityFactory.CreateWithParent <Session, AChannel>(this, channel);

            this.Sessions.Add(session.Id, session);
            channel.Start();
            return(session);
        }
コード例 #3
0
ファイル: NetworkComponent.cs プロジェクト: pinzeweifen/DCET
        /// <summary>
        /// 创建一个新Session
        /// </summary>
        public Session Create(IPEndPoint ipEndPoint)
        {
            AChannel channel = this.Service.ConnectChannel(ipEndPoint);
            Session  session = EntityFactory.CreateWithParent <Session, AChannel>(this, channel);

            this.Sessions.Add(session.Id, session);
            channel.Start();
            return(session);
        }