コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <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();
 }
コード例 #3
0
        /// <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]);
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        /// <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];
        }
コード例 #6
0
        /// <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();
        }
コード例 #7
0
ファイル: SeverSession.cs プロジェクト: goddie/Unity3DSocket
        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();
        }
コード例 #8
0
ファイル: ClientSession.cs プロジェクト: goddie/Unity3DSocket
        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;
        }
コード例 #9
0
 public DummySeverSession(DispatchFactoryBase dispatchFactory, int port)
 {
     this.m_cDispatchFactory = dispatchFactory;
     this.m_cDispatch = dispatchFactory.Create(this);
     this.m_iPort = port;
 }
コード例 #10
0
        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;
        }
コード例 #11
0
 public DummySeverSession(DispatchFactoryBase dispatchFactory, int port)
 {
     this.m_cDispatchFactory = dispatchFactory;
     this.m_cDispatch        = dispatchFactory.Create(this);
     this.m_iPort            = port;
 }
コード例 #12
0
ファイル: Accept.cs プロジェクト: sandyway/Unity3DSocket
        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);
        }
コード例 #13
0
        private List<ISession> m_lstSessions = new List<ISession>(); //会话对象集合

        #endregion Fields

        #region Constructors

        public SeverSessionManager( DispatchFactoryBase dispatchFactory )
        {
            this.m_cDispatchFactory = dispatchFactory;
        }
コード例 #14
0
ファイル: DummyAccept.cs プロジェクト: goddie/Unity3DSocket
 public DummyAccept(int port , DispatchFactoryBase dispatchFactory)
 {
     this.m_iPort = port;
     this.m_cDispatchFactory = dispatchFactory;
 }
コード例 #15
0
ファイル: DummyAccept.cs プロジェクト: sandyway/Unity3DSocket
 public DummyAccept(int port, DispatchFactoryBase dispatchFactory)
 {
     this.m_iPort            = port;
     this.m_cDispatchFactory = dispatchFactory;
 }
コード例 #16
0
        private DispatchFactoryBase m_cDispatchFactory;                //调度工厂对象

        public SeverSessionManager(DispatchFactoryBase dispatchFactory)
        {
            this.m_cDispatchFactory = dispatchFactory;
        }
コード例 #17
0
ファイル: AcceptManager.cs プロジェクト: goddie/Unity3DSocket
 /// <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);
 }
コード例 #18
0
ファイル: Accept.cs プロジェクト: goddie/Unity3DSocket
        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 );
        }
コード例 #19
0
        private int m_iPort; //连接端口

        #endregion Fields

        #region Constructors

        public DummyClientSession(DispatchFactoryBase dispatchFactory)
        {
            this.m_cDispatchFactory = dispatchFactory;
        }
コード例 #20
0
        private int m_iPort;                                                               //监听端口

        public DummySeverSessionManager(DispatchFactoryBase dispatchFactory, int port)
        {
            this.m_iPort            = port;
            this.m_cDispatchFactory = dispatchFactory;
        }