Esempio n. 1
0
 private static void Heat(object dataBuffer)
 {
     try
     {
         BeatMessage beatMessage = new BeatMessage();
         beatMessage.HostIP = ServerProfile.ServerIP;
         BeatResult result = InstructionServiceBusiness.HeartBeat(beatMessage);
         Process.Debug(ikey, "发送心跳到指令中心", "Heat", "", "发送心跳到指令中心,返回消息:" + JsonConvert.SerializeObject(result), "");
     }
     catch (Exception ex)
     {
         Process.Error(ikey, "发送心跳到指令中心", "Heat", "", "发送心跳到指令中心,发生异常:" + ex.GetString(), "");
     }
     finally
     {
         SystemHeatService.AddDataToBuffer();
     }
 }
Esempio n. 2
0
 public static void Register()
 {
     ThreadPool.QueueUserWorkItem(x =>
     {
         try
         {
             BeatMessage beatMessage = new BeatMessage();
             beatMessage.HostIP      = ServerProfile.ServerIP;
             bool result             = InstructionServiceBusiness.RegisterServer(beatMessage);
             SystemHeatService.AddDataToBuffer();
             Process.Info(ikey, "注册系统到指令中心", "Register", "", "注册系统到指令中心,返回消息:" + result, "");
         }
         catch (Exception ex)
         {
             Process.Error(ikey, "注册系统到指令中心", "Register", "", "注册系统到指令中心,发生异常:" + ex.GetString(), "");
         }
     });
 }