public void stop ( int timeoutMS ) throws Exception { log . info ( "Robot Framework remote server stopping" ) ; if ( timeoutMS > 0 ) { server . setGracefulShutdown ( timeoutMS ) ; Thread stopper = new Thread ( ) { @ Override public void run ( ) { try { server . stop ( ) ; } catch ( Throwable e ) { log . error ( String . format ( "Failed to stop the server: %s" , e . getMessage ( ) ) , e ) ; } } } ; stopper . start ( ) ; } else { server . stop ( ) ; } }
A non - blocking method for stopping the remote server that allows requests to complete within the given timeout before shutting down the server . New connections will not be accepted after calling this .