关闭死锁
parent
db90677dcd
commit
915f3ea59a
|
@ -90,11 +90,11 @@ public class NettyGameServer extends AbstractServer {
|
|||
ChannelFuture channelFuture = serverBootstrap.bind(getLocalAddress().getPort()).sync();
|
||||
this.channel = channelFuture.channel();
|
||||
//同步关闭改异步回调 优雅关闭netty
|
||||
this.channel.closeFuture().addListener((ChannelFutureListener) future -> close());
|
||||
this.channel.closeFuture().addListener((ChannelFutureListener) future -> LOGGER.info("netty shutdown completed"));
|
||||
} catch (Exception e) {
|
||||
close();
|
||||
throw new ConnectException("close exception", getLocalAddress(), null);
|
||||
} finally {
|
||||
// close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,10 +136,8 @@ public class NettyGameServer extends AbstractServer {
|
|||
} catch (Throwable var2) {
|
||||
LOGGER.error("close NettyChannel exception" + var2);
|
||||
}
|
||||
|
||||
bossGroup.shutdownGracefully();
|
||||
workerGroup.shutdownGracefully();
|
||||
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("close exception", getLocalAddress());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue