예제 #1
0
 static void StartService()
 {
     SQL.Init();
     Core CoreInSer = new Core();
     AsServer Server = new AsServer(IPAddress.Any, 5000);
     ComPortListener ComPotrList = new ComPortListener();
     WinLog.Init();
     CoreInSer.Start();
     Thread ServerThread = new Thread(Server.Start);
     ServerThread.IsBackground = true;
     ServerThread.Start();
     Thread CPList = new Thread(ComPotrList.OpenCom);
     CPList.IsBackground = true;
     CPList.Start();
     CoreInSer.UpdateClient();
 }
예제 #2
0
        static void Main(string[] args)
        {
            SQL.Init();
            Core CoreInSer = new Core();

            // TODO: Настройки вынести в отдельный конфигурационный файл

            AsServer Server = new AsServer(IPAddress.Any, 5000);
            ComPortListener ComPotrList = new ComPortListener();
            WinLog.Init();
            CoreInSer.Start();
            Thread ServerThread = new Thread(Server.Start);
            ServerThread.IsBackground = true;
            ServerThread.Start();
            Thread CPList = new Thread(ComPotrList.OpenCom);
            CPList.IsBackground = true;
            CPList.Start();
            CoreInSer.UpdateClient();
            Console.WriteLine("Server started");
            Console.WriteLine("OK");
            Console.ReadLine();
        }