Example #1
0
 public void Kill()
 {
     if (_isActive == false)
     {
         return;
     }
     _isActive = false;
     try
     {
         _inStream.Close();
     }
     catch (Exception)
     {
     }
     try
     {
         _outStream.Close();
     }
     catch (Exception)
     {
     }
     try
     {
         if (_readerThread.Thread.IsAlive)
         {
             _readerThread.Abort();
         }
     }
     catch (Exception ex)
     {
     }
     finally
     {
         if (Closed != null)
         {
             Closed(this);
         }
     }
 }
Example #2
0
 public void Kill()
 {
     _active = false;
     _acceptorThread.Abort();
     _tcpListener.Stop();
 }