using HDLMonitorService.ServiceMonitor;
|
using HDLMonitorService.UDP;
|
using System;
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Data;
|
using System.Diagnostics;
|
using System.Linq;
|
using System.ServiceProcess;
|
using System.Text;
|
using System.Threading;
|
using HDLMonitorService.Helper;
|
|
namespace HDLMonitorService
|
{
|
public partial class HDLMonitorService : ServiceBase
|
{
|
public HDLMonitorService()
|
{
|
InitializeComponent();
|
}
|
|
protected override void OnStart(string[] args)
|
{
|
try
|
{
|
//启动HttpListener监听服务注册
|
MyHttpListener.Listener();
|
|
//启动发送服务心跳的线程
|
ServiceHandler.HeartThread();
|
|
//检测服务是否长时间离线的线程
|
ServiceHandler.CheckService();
|
|
//监控数据转发服务
|
ServerMonitor.monitorServer();
|
|
//启动UDP的通信Socket
|
UDPServer.Start();
|
|
//监控设备状态缓存服务
|
DeviceCacheServiceMonitor.monitorDeviceCacheServer();
|
|
//监控小度语音控制
|
DuerOsMonitor.monitor();
|
|
//监控Alexa语音控制
|
AlexaMonitor.monitor();
|
|
//监控App接口
|
ApiGatewayInfoMonitor.monitor();
|
|
//接收业务异常报警
|
ListenerAlarm.Listener();
|
}
|
catch (Exception ex)
|
{
|
LogHp.WriteLog("启动服务异常", Newtonsoft.Json.JsonConvert.SerializeObject(ex));
|
}
|
}
|
|
protected override void OnStop()
|
{
|
|
|
}
|
}
|
}
|