Esempio n. 1
0
 public void HandleClient(TcpClient client)
 {
     new Task(() =>
     {
         try
         {
             ClientConnectionInfo connectionInfo = new ClientConnectionInfo(client);
             while (connectionInfo.ShouldKeepConnection)
             {
                 string command = connectionInfo.Reader.ReadLine();
                 if (command != "" && command != null)
                 {
                     Controller.HandleCommand(command, connectionInfo);
                 }
             }
             System.Threading.Thread.Sleep(1000);
             connectionInfo.CloseConnection();
         }
         catch (Exception e)
         {
             Exception e1 = e.InnerException;
         }
     }).Start();
 }