public static void ReadUpdate() { while (true) { Thread.Sleep(5000); if (GatewayServer.getClientCount() == 0) { CollectGarbage(); break; } //Thread.Sleep(cfgGateway.intGarbageCollectTime); } }
private static void Start() { try { //GatewayServer s_Tcp = new GatewayServer(cfgGateway.strIP, cfgGateway.strPort); GatewayServer s_Tcp = new GatewayServer("192.168.1.2", "15550"); ConsoleUpdate(); ReadUpdate(); } catch (Exception ex) { Logger.ExceptionToLog(ex, "[Program::Start()] -> TcpServer error."); } }
public static void ConsoleUpdate() { while (true) { Console.Title = Assembly.GetExecutingAssembly().GetName().Name + "[Clients:" + GatewayServer.getClientCount() + "]"; Thread.Sleep(10); //Thread.Sleep(cfgGateway.intGarbageCollectTime); } }