void () { try { //final long stopStart = System.nanoTime(); //System.err.println("Exiting. Since global start " + TimeUnit.NANOSECONDS.toMillis(stopStart - myGlobalStart)); final ChannelFuture future = myConnectFuture; if (future != null) { future.channel().close().await(); } myEventLoopGroup.shutdownGracefully(0, 15, TimeUnit.SECONDS).await(); //final long stopEnd = System.nanoTime(); //System.err.println("Stop completed in " + TimeUnit.NANOSECONDS.toMillis(stopEnd - stopStart) + "ms; since global start: " + TimeUnit.NANOSECONDS.toMillis(stopEnd - myGlobalStart)); System.exit(0); } catch (Throwable e) { e.printStackTrace(System.err); System.exit(-1); } }