Set of helper methods for the test service.
コード例 #1
0
 private void StartShutdownMonitorThread()
 {
     while (Listening && (DateTime.Now < _shutdownTime))
     {
         Thread.Sleep(100);
     }
     if (Listening)
     {
         Listening = false;
     }
     try
     {
         for (int i = 0; i < 3; i++)
         {
             TestServiceHelper.PingService(HostName);
         }
     }
     catch
     {
     }
 }
コード例 #2
0
 public void Stop()
 {
     if (Service.Listening)
     {
         Service.Listening = false;
         try
         {
             try
             {
                 for (int i = 0; i < 5; i++)
                 {
                     TestServiceHelper.PingService(Service.HostName);
                 }
             }
             catch (WebException)
             {
             }
         }
         catch
         {
         }
     }
     Thread = null;
 }