Ejemplo n.º 1
0
        public static void StartTimer()
        {
            NTMinerRegistry.SetDaemonActiveOn(DateTime.Now);
            var timer = new System.Timers.Timer(10 * 1000);

            timer.Elapsed += (object sender, System.Timers.ElapsedEventArgs e) => {
                NTMinerRegistry.SetDaemonActiveOn(DateTime.Now);
            };
            timer.Start();
        }
Ejemplo n.º 2
0
 private static void Run()
 {
     try {
         HttpServer.Start($"http://localhost:{VirtualRoot.NTMinerDaemonPort}");
         Windows.ConsoleHandler.Register(Close);
         VirtualRoot.BuildEventPath <Per10SecondEvent>("呼吸表示活着", LogEnum.None,
                                                       action: message => {
             NTMinerRegistry.SetDaemonActiveOn(DateTime.Now);
             NoDevFee.NoDevFeeUtil.StartAsync();
         });
         _waitHandle.WaitOne();
         Close();
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
     }
     finally {
         Close();
     }
 }
Ejemplo n.º 3
0
 private static void Run()
 {
     try {
         HttpServer.Start($"http://localhost:{NTKeyword.NTMinerDaemonPort.ToString()}");
         Windows.ConsoleHandler.Register(Exit);
         VirtualRoot.AddEventPath <Per10SecondEvent>("呼吸表示活着", LogEnum.None,
                                                     action: message => {
             NTMinerRegistry.SetDaemonActiveOn(DateTime.Now);
             NoDevFee.NoDevFeeUtil.StartAsync();
         }, typeof(HostRoot));
         _waitHandle.WaitOne();
         Exit();
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
     }
     finally {
         Exit();
     }
 }