Ejemplo n.º 1
0
 private void Execute(string command, MyTuple t)
 {
     Console.WriteLine("EXECUTAR");
     while (true)
     {
         try
         {
             Command c = new Command(command, t, MyAddress);
             ss.RX_Command(c);
             while (BlockUntilAnswer == false)
             {
                 ;
             }
             BlockUntilAnswer = false;
             break;
         }
         catch (System.Net.Sockets.SocketException e)
         {
             Console.WriteLine("AQUI");
             Stopwatch sw = new Stopwatch();
             sw.Start();
             while (SearchForRootServer() == false) //Search for ROOT
             {
                 if (sw.ElapsedMilliseconds > Timeout)
                 {
                     Console.WriteLine("No Server available.");
                     Console.WriteLine("Retrying in {0} [s]", Timeout);
                     Thread.Sleep(Timeout);
                     //break;
                 }
             }
         }
     }
 }