File was renamed from RestartService/RestartService/Service1.cs |
| | |
| | | using System.Threading.Tasks; |
| | | using System.Timers; |
| | | using System.Configuration; |
| | | using RestartService.Monitor; |
| | | |
| | | namespace RestartService |
| | | { |
| | | public partial class Service1 : ServiceBase |
| | | public partial class RestartService : ServiceBase |
| | | { |
| | | public Service1() |
| | | public RestartService() |
| | | { |
| | | InitializeComponent(); |
| | | } |
| | | |
| | | protected override void OnStart(string[] args) |
| | | { |
| | | UDPServer.Start(); |
| | | EmqxClientMonitor.monitor(); |
| | | ServerMonitor.monitorServer(); |
| | | EmqxPushMonitor.monitor(); |
| | | Start(); |
| | | } |
| | | |
| | | void Start() |
| | | { |
| | | var t = new Timer(1000 * 10);//实例化Timer类,设置间隔时间为10秒; |
| | | t.Elapsed += (object source, System.Timers.ElapsedEventArgs e) => |
| | | { |