/******Connection handling section******/ //Check connection to server private void Connected() { try { if (myAC.fUniversal("CONN CHECK").Equals("1")) //Connection present { log.Debug("Successfully connected to server!"); Console.WriteLine("Successfully connected to server!"); System.Threading.Thread.Sleep(1500); } } catch (Exception ex) { Console.WriteLine("Error while connecting to server!"); log.Debug("Error while connecting to server!"); System.Threading.Thread.Sleep(1500); Exit(); } }