public synchronized void stop ( ) throws IOException { this . stopped = true ; if ( this . server != null && this . waitingClient ) { this . server . close ( ) ; this . server = null ; } }
Stop the server instance by setting the stopped flag to true the close the server instance if open .