生效定时检查逻辑
This commit is contained in:
commit
bbdf6cf75f
1 file changed
+6
-2
@@ -24,7 +24,10 @@ namespace ForwardingServerUI.Class
|
|||||||
public required string SERRVERPASWORD { get; set; }
|
public required string SERRVERPASWORD { get; set; }
|
||||||
public required string MachineVer { get; set; }
|
public required string MachineVer { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Timer? _timer;
|
||||||
public static TcpService service = new TcpService();
|
public static TcpService service = new TcpService();
|
||||||
|
|
||||||
public static async Task TcpMain()
|
public static async Task TcpMain()
|
||||||
{
|
{
|
||||||
//TcpService service = new TcpService();
|
//TcpService service = new TcpService();
|
||||||
@@ -157,9 +160,10 @@ namespace ForwardingServerUI.Class
|
|||||||
|
|
||||||
Console.WriteLine("TcpServer:Run");
|
Console.WriteLine("TcpServer:Run");
|
||||||
|
|
||||||
Timer timer = new Timer(TimerCallback, null, TimeSpan.FromSeconds(90), TimeSpan.FromSeconds(30));
|
//启动检查循环定时器
|
||||||
|
_timer = new Timer(TimerCallback, null, TimeSpan.FromSeconds(90), TimeSpan.FromSeconds(30));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async void TimerCallback(object? state)
|
private static async void TimerCallback(object? state)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in new issue
Block a user