/// <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); }
private SeverSessionManager m_cSeverMgr; //会话管理类 public Accept(int port, DispatchFactoryBase dispatchFactory) { this.m_iPort = port; this.m_cDispatchFactory = dispatchFactory; this.m_cSeverMgr = new SeverSessionManager(this.m_cDispatchFactory); }
private SeverSessionManager m_cSeverMgr; //会话管理类 #endregion Fields #region Constructors public Accept(int port, DispatchFactoryBase dispatchFactory) { this.m_iPort = port; this.m_cDispatchFactory = dispatchFactory; this.m_cSeverMgr = new SeverSessionManager( this.m_cDispatchFactory ); }