Beispiel #1
0
        public static void Main()
        {
            var _server = new testserver();

            Int64 tick = Environment.TickCount;
            Int64 tickcount = 0;

            while (true)
            {
                Int64 tmptick = (Environment.TickCount & UInt32.MaxValue);
                if (tmptick < tick)
                {
                    tickcount += 1;
                    tmptick = tmptick + tickcount * UInt32.MaxValue;
                }
                tick = tmptick;

                foreach (var item in _server._service_list)
                {
                    item.poll(tick);
                }

                tmptick = (Environment.TickCount & UInt32.MaxValue);
                if (tmptick < tick)
                {
                    tickcount += 1;
                    tmptick = tmptick + tickcount * UInt32.MaxValue;
                }
                Int64 ticktime = (tmptick - tick);
                tick = tmptick;

                if (ticktime < 100)
                {
                    Thread.Sleep(15);
                }
            }
        }
Beispiel #2
0
        public static void Main()
        {
            var _server = new testserver();

            Int64 tick      = Environment.TickCount;
            Int64 tickcount = 0;

            while (true)
            {
                Int64 tmptick = (Environment.TickCount & UInt32.MaxValue);
                if (tmptick < tick)
                {
                    tickcount += 1;
                    tmptick    = tmptick + tickcount * UInt32.MaxValue;
                }
                tick = tmptick;

                foreach (var item in _server._service_list)
                {
                    item.poll(tick);
                }

                tmptick = (Environment.TickCount & UInt32.MaxValue);
                if (tmptick < tick)
                {
                    tickcount += 1;
                    tmptick    = tmptick + tickcount * UInt32.MaxValue;
                }
                Int64 ticktime = (tmptick - tick);
                tick = tmptick;

                if (ticktime < 100)
                {
                    Thread.Sleep(15);
                }
            }
        }