/// <summary>
        /// 创建服务端会话对象
        /// </summary>
        /// <param name="socket"></param>
        /// <param name="dispatch"></param>
        /// <returns></returns>
        public ISession CreateSession(Socket socket)
        {
            SeverSession session = new SeverSession(socket, this.m_cDispatchFactory);

            this.m_lstSessions.Add(session);
            return(session);
        }
Beispiel #2
0
        /// <summary>
        /// 调度方法
        /// </summary>
        /// <param name="arg"></param>
        /// <param name="transferredNum"></param>
        /// <returns></returns>
        public override bool Dispatch(object arg, int transferredNum)
        {
            SeverSessionManager mgr     = (SeverSessionManager)arg;
            SeverSession        session = (SeverSession)mgr.CreateSession(this.AcceptSocket);

            session.Receive();
            return(true);
        }
 /// <summary>
 /// 创建服务端会话对象
 /// </summary>
 /// <param name="socket"></param>
 /// <param name="dispatch"></param>
 /// <returns></returns>
 public ISession CreateSession( Socket socket )
 {
     SeverSession session = new SeverSession(socket, this.m_cDispatchFactory);
     this.m_lstSessions.Add(session);
     return session;
 }