Beispiel #1
0
    static void ProcessMessages(int seconds)
    {
        Console.WriteLine("Waiting for message(s)");

        for (int i = 0, reps = seconds * 10; i < reps; i++)
        {
            Thread.Sleep(100);
            ATMI.tpchkunsol();
        }
    }
Beispiel #2
0
 private static void WaitForMessages(int timeout)
 {
     while (timeout > 0)
     {
         Console.WriteLine("Waiting for unsolicited message(s)");
         Thread.Sleep(1000);
         if (ATMI.tpchkunsol() > 0)
         {
             return;
         }
         timeout--;
     }
     Console.WriteLine("Giving up");
 }