Ejemplo n.º 1
0
        private static void Main(String[] args)
        {
            if (args.Length <= 0)
            {
                log.log.error(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "non input start argv");
                return;
            }

            dbproxy _dbproxy = new dbproxy(args);

            while (true)
            {
                var ticktime = _dbproxy.poll();

                if (closeHandle.is_close())
                {
                    log.log.operation(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "server closed, dbproxy server:{0}", dbproxy.uuid);
                    break;
                }

                if (ticktime > 200)
                {
                    is_busy = true;
                }
                else
                {
                    is_busy = false;
                }

                if (ticktime < 50)
                {
                    Thread.Sleep(5);
                }
            }
        }
Ejemplo n.º 2
0
        private static void Main(String[] args)
        {
            if (args.Length <= 0)
            {
                System.Console.WriteLine("non input start argv");
                return;
            }

            dbproxy _dbproxy = new dbproxy(args);

            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;

                _dbproxy.poll(tick);

                if (closeHandle.is_close())
                {
                    Console.WriteLine("server closed, hub server " + dbproxy.uuid);
                    break;
                }

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

                if (ticktime > 200)
                {
                    is_busy = true;
                }
                else
                {
                    is_busy = false;
                }

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