/// <summary>
 /// Stop the background thread. If it is already stopped, do nothing.
 /// </summary>
 private void StopBackgroundThread()
 {
     if (BackgroundThread.IsAlive)
     {
         Stopping = true;
         Flush();
         BackgroundThread.Join();
     }
 }
Beispiel #2
0
 public void Close()
 {
     BackgroundThreadContinue = false;
     BackgroundThread.Interrupt();
     BackgroundThread.Abort();
     BackgroundThread.Join();
     Send("Have a nice day!");
     ClientSocket.Close();
     ClientProcess.Close();
     OnExited(this);
 }
Beispiel #3
0
 // Stops the background thread and its {@link Handler}.
 private void StopBackgroundThread()
 {
     BackgroundThread.QuitSafely();
     try
     {
         BackgroundThread.Join();
         BackgroundThread  = null;
         BackgroundHandler = null;
     }
     catch (InterruptedException e)
     {
         e.PrintStackTrace();
     }
 }