public void stop() throws IOException, InterruptedException {
  thread.interrupt();
  selector.wakeup();
}

public void stop ( ) throws IOException , InterruptedException { thread . interrupt ( ) ; selector . wakeup ( ) ; }
disconnects and stops the client .
