public void stopAndJoin() {
    interrupt();
    if (mServerSocket != null) {
      try {
        mServerSocket.close();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
    try {
      join(5 * Constants.SECOND_MS);
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
    }
    if (isAlive()) {
      LOG.warn("Failed to stop rejecting server thread");
    }
  }
public void stopAndJoin ( ) { interrupt ( ) ; if ( mServerSocket != null ) { try { mServerSocket . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } try { join ( 5 * Constants . SECOND_MS ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } if ( isAlive ( ) ) { LOG . warn ( "Failed to stop rejecting server thread" ) ; } }
Stops the server and joins the server thread.