You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using Ems.CollectService.Entity.config;
|
|
using Ems.CollectService.Timer;
|
|
using Ems.CollectService.TouchSocket;
|
|
using NLog;
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Ems.CollectService
|
|
{
|
|
internal class Program
|
|
{
|
|
private static Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
private static TcpServer service = TcpServer.Instance;
|
|
|
|
private static AppConfig appConfig = AppConfig.Instance;
|
|
|
|
private static DeleteLogFile deleteLogFile = DeleteLogFile.Instance;
|
|
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
try
|
|
{
|
|
service.Init(appConfig.listenerPort);
|
|
service.ReadMeterTask(appConfig.readMeterFlag);
|
|
//定时删除日志文件夹
|
|
deleteLogFile.DeleteLogFileTimer();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
logger.Error($"服务启动异常{ex.Message}");
|
|
}
|
|
//Console.ReadLine();
|
|
|
|
while (true)
|
|
{
|
|
Task.Delay(1000 * 10).Wait();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|