コード例 #1
0
 static void Main(string[] args)
 {
     try
     {
         server       = new ServerObject();
         listenThread = new Thread(new ThreadStart(server.Listen));
         listenThread.Start();
     }
     catch (Exception ex)
     {
         server.Disconnect();
         Console.WriteLine(ex.Message);
     }
 }
コード例 #2
0
        static Thread listenThread; // thread for listener

        static void Main(string[] args)
        {
            //start the scheduler receiving from the external server and saving in local database of weather on schedule

            UpdateSheduler sheduler = new UpdateSheduler(minutesInterval: 1, cities: Setting.Cities);

            sheduler.Start();

            try
            {
                server = new ServerObject();

                //create listener
                listenThread = new Thread(new ThreadStart(server.Listen));
                listenThread.Start();
            }
            catch (Exception ex)
            {
                server.Disconnect();
                Console.WriteLine(ex.Message);
            }
        }