void start() { connection.setErrorHandler( th -> { log.debug("QUIT failed, ignoring exception", th); resultHandler.handle(null); }); connection.write( "QUIT", message -> { log.debug("QUIT result: " + message); if (!StatusCode.isStatusOk(message)) { log.warn("quit failed: " + message); } resultHandler.handle(null); }); }