/// <summary> /// 创建监听对象 /// </summary> /// <param name="port"></param> /// <param name="dispatchFactory"></param> public void CreateAccept(int port, DispatchFactoryBase dispatchFactory) { Accept accept = new Accept(port, dispatchFactory); accept.Initialize(); this.m_lstAccepts.Add(accept); }
/// <summary> /// 创建监听对象 /// </summary> /// <param name="port"></param> /// <param name="dispatchFactory"></param> public void CreateAccept(int port, DispatchFactoryBase dispatchFactory) { DummyAccept accept = new DummyAccept(port, dispatchFactory); if (this.m_mapAccept.ContainsKey(port)) { //ERROR return; } this.m_mapAccept.Add(port, accept); accept.Initialize(); }
/// <summary> /// 创建会话 /// </summary> /// <param name="define"></param> /// <param name="dispatchFactory"></param> /// <returns></returns> public ISession CreateSession(int define, DispatchFactoryBase dispatchFactory) { if (this.m_vecSession.Length <= define) { //Error return(null); } this.m_vecSession[define] = new ClientSession(dispatchFactory); return(this.m_vecSession[define]); }
private SESSION_STATUS m_cStatus; //会话状态 public SeverSession(Socket socket, DispatchFactoryBase dispatchFactory) { this.m_cDispatchFactory = dispatchFactory; this.m_cDispatch = this.m_cDispatchFactory.Create(this); this.m_cSocket = socket; this.m_cReceiveBuffer = new StreamBuffer(); this.m_cSendBuffer = new StreamBuffer(); this.m_cSendQueue = new NetQueue <PacketBase>(64 * 256); this.m_cSendQueue.Clear(); }
/// <summary> /// 创建会话 /// </summary> /// <param name="define"></param> /// <param name="dispatchFactory"></param> /// <returns></returns> public ISession CreateSession(int define, DispatchFactoryBase dispatchFactory) { if (this.m_vecSession.Length <= define) { //Error return null; } this.m_vecSession[define] = new ClientSession(dispatchFactory); return this.m_vecSession[define]; }
private SESSION_STATUS m_cStatus; //会话状态 #endregion Fields #region Constructors public SeverSession(Socket socket, DispatchFactoryBase dispatchFactory) { this.m_cDispatchFactory = dispatchFactory; this.m_cDispatch = this.m_cDispatchFactory.Create( this ); this.m_cSocket = socket; this.m_cReceiveBuffer = new StreamBuffer(); this.m_cSendBuffer = new StreamBuffer(); this.m_cSendQueue = new NetQueue<PacketBase>(64 * 256); this.m_cSendQueue.Clear(); }
private string m_strAddress; //连接地址 #endregion Fields #region Constructors public ClientSession( DispatchFactoryBase dispatchFactory ) { this.m_cStatus = SESSION_STATUS.NO_CONNECT; this.m_cDispatchFactory = dispatchFactory; this.m_cReceiveBuffer = new StreamBuffer(); this.m_cSendBuffer = new StreamBuffer(); this.m_cSendQueue = new NetQueue<PacketBase>(64 * 256); this.m_cSendQueue.Clear(); this.m_bStartReConnect = false; }
public DummySeverSession(DispatchFactoryBase dispatchFactory, int port) { this.m_cDispatchFactory = dispatchFactory; this.m_cDispatch = dispatchFactory.Create(this); this.m_iPort = port; }
private List<IDummySeverSession> m_lstSessions = new List<IDummySeverSession>(); //会话集合 #endregion Fields #region Constructors public DummySeverSessionManager( DispatchFactoryBase dispatchFactory , int port ) { this.m_iPort = port; this.m_cDispatchFactory = dispatchFactory; }
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 List<ISession> m_lstSessions = new List<ISession>(); //会话对象集合 #endregion Fields #region Constructors public SeverSessionManager( DispatchFactoryBase dispatchFactory ) { this.m_cDispatchFactory = dispatchFactory; }
public DummyAccept(int port , DispatchFactoryBase dispatchFactory) { this.m_iPort = port; this.m_cDispatchFactory = dispatchFactory; }
public DummyAccept(int port, DispatchFactoryBase dispatchFactory) { this.m_iPort = port; this.m_cDispatchFactory = dispatchFactory; }
private DispatchFactoryBase m_cDispatchFactory; //调度工厂对象 public SeverSessionManager(DispatchFactoryBase dispatchFactory) { this.m_cDispatchFactory = dispatchFactory; }
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 ); }
private int m_iPort; //连接端口 #endregion Fields #region Constructors public DummyClientSession(DispatchFactoryBase dispatchFactory) { this.m_cDispatchFactory = dispatchFactory; }
private int m_iPort; //监听端口 public DummySeverSessionManager(DispatchFactoryBase dispatchFactory, int port) { this.m_iPort = port; this.m_cDispatchFactory = dispatchFactory; }