Allow netty server to close with open connections
@@ -107,14 +107,15 @@ public URL getUrl() {
@Override
public void stop() {
try {
+ bossGroup.shutdownGracefully().sync();
+ workerGroup.shutdownGracefully().sync();
+
channel.closeFuture().sync();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new UncheckedIOException(new IOException("Shutdown interrupted", e));
} finally {
channel = null;
- bossGroup.shutdownGracefully();
- workerGroup.shutdownGracefully();
}
}
