예제 #1
0
        private void ProcessListener()
        {
            TickManager tickManager = new TickManager(500, (TickManager.TickDelegate)(() => this._serverSocket.CheckAcceptClient()));

            while (true)
            {
                tickManager.Tick();
            }
        }
예제 #2
0
        private void ProcessWriter(object indexObject)
        {
            int         index       = (int)indexObject;
            TickManager tickManager = new TickManager(5000, (TickManager.TickDelegate)(() =>
            {
                foreach (ServersideSession serversideSession in (IEnumerable <ServersideSession>) this._peers[index].Values)
                {
                    serversideSession?.Socket.ProcessWrite();
                }
            }));

            while (true)
            {
                tickManager.Tick();
            }
        }
예제 #3
0
        private void ProcessSingle()
        {
            TickManager tickManager = new TickManager(5000, (TickManager.TickDelegate)(() =>
            {
                foreach (ServersideSession serversideSession in (IEnumerable <ServersideSession>) this._peers[0].Values)
                {
                    if (serversideSession != null)
                    {
                        serversideSession.Socket.ProcessWrite();
                        serversideSession.Socket.ProcessRead();
                    }
                }
                this._serverSocket.CheckAcceptClient();
            }));

            while (true)
            {
                tickManager.Tick();
            }
        }