Esempio n. 1
0
 /// <summary>
 /// Start The Server
 /// </summary>
 /// <param name="s"></param>
 public bool Start(System.Net.IPEndPoint ip, out string ErrorMsg)
 {
     ErrorMsg = string.Empty;
     if (database.IsConnectionStringValid())
     {
         Active = true;
         database.ResetAllUsers();
         try
         {
             listner = new TcpListener(ip);
             listner.Start();
         }
         catch (Exception e)
         {
             Console.WriteLine("Server || Start |" + e.Message);
             ErrorMsg = "Couldn't Start A Lister With Given IP";
             return(false);
         }
         new Thread(StartRecivingClients).Start();
         return(true);
     }
     ErrorMsg = "Couldn't Connect To The DataBase";
     return(false);
 }