List of usage examples for io.netty.channel.group ChannelGroupFuture awaitUninterruptibly
boolean awaitUninterruptibly(long timeout, TimeUnit unit);
From source file:poke.server.Server.java
License:Apache License
/** * static because we need to get a handle to the factory from the shutdown * resource/*from ww w . j a v a 2s. c om*/ */ public static void shutdown() { try { if (allChannels != null) { ChannelGroupFuture grp = allChannels.close(); grp.awaitUninterruptibly(5, TimeUnit.SECONDS); } } catch (Exception ex) { ex.printStackTrace(); } logger.info("Server shutdown"); System.exit(0); }