public void stop() throws InterruptedException {
  stopped=true;
  if (thd != null) {
    try {
      logger.info("Stopping server thread");
      socketService.close();
      thd.interrupt();
      thd.join();
      thd=null;
    }
 catch (    InterruptedException e) {
      logger.info("THL stop operation interrupted: " + e);
      throw e;
    }
  }
}

public void stop ( ) throws InterruptedException { stopped = true ; if ( thd != null ) { try { logger . info ( "Stopping server thread" ) ; socketService . close ( ) ; thd . interrupt ( ) ; thd . join ( ) ; thd = null ; } catch ( InterruptedException e ) { logger . info ( "THL stop operation interrupted: " + e ) ; throw e ; } } }
stop the thl server , which cancels the service thread .
