Beispiel #1
0
        // The main server loop
        public void MainLoop()
        {
            basePeriod = 1;
            period     = basePeriod;

            var timerObject = new MainLoopTimer();

            stopWatch.Start();
            mainLoopTimer = timerObject.mainLoopTimer.CreateMainLoopTimer(() =>
            {
                RunLoop();
            }, period);

            while (Active)
            {
                are.WaitOne(-1);

                DoMainLoopStuff();
            }

            Cleanup();

            /*   TimerCallback tcb = RunLoop;
             * var due = 1;// (long)ServerRate / 3;
             * stopWatch.Start(); //Start the clock
             * mainLoopTimer = new Timer(tcb, are, 0, due);
             * are.WaitOne(-1);*/
        }
        // The main server loop
        public void MainLoop() 
        {
            basePeriod = 1;
            period = basePeriod;

            var timerObject = new MainLoopTimer();
            stopWatch.Start();
            mainLoopTimer = timerObject.mainLoopTimer.CreateMainLoopTimer(() =>
                                                       {
                                                       RunLoop();
                                                       }, period);
            
            while (Active)
            {
                are.WaitOne(-1);

                DoMainLoopStuff();
            }
            /*   TimerCallback tcb = RunLoop;
            var due = 1;// (long)ServerRate / 3;
            stopWatch.Start(); //Start the clock
            mainLoopTimer = new Timer(tcb, are, 0, due);
            are.WaitOne(-1);*/
        }