public void stopServer() { //FIRST END THE THREAD LOOP Console.WriteLine("Desligando Servidor..."); this.serverStatus = serverStatuses.Shutting; //DO THE BACKUP AND START TO FINISH STUFF Thread.Sleep(2000); Console.WriteLine("Servidor Offline."); this.serverStatus = serverStatuses.Offline; }
private void serverStart() { try { Console.WriteLine("Iniciando Servidor..."); serverStatus = serverStatuses.Initializing; _serverThread = new Thread(new ThreadStart(this.serverLoop)); _database = new Database(); //END Console.WriteLine("Servidor Online!"); serverStatus = serverStatuses.Online; _serverThread.IsBackground = true; _serverThread.Start(); } catch (SqlException e) { Console.WriteLine(e.ToString()); } }