Skip to content

Commit

Permalink
Allow netty server to close with open connections
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Feb 4, 2020
1 parent 177754a commit 35725b2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 35725b2

Please sign in to comment.