99100101102103104105106107108
// Wait until all messages are flushed before closing the channel. if (lastWriteFuture != null) { lastWriteFuture.awaitUninterruptibly(); } } finally { serverGroup.shutdownGracefully(); clientGroup.shutdownGracefully(); } } }