From 96c02199d1f1f2d2e280bf53c30d323ab5a147d5 Mon Sep 17 00:00:00 2001 From: zhangshanxue Date: Tue, 17 Dec 2019 11:46:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ljsd/jieling/netty/server/NettyGameServer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netty/src/main/java/com/ljsd/jieling/netty/server/NettyGameServer.java b/netty/src/main/java/com/ljsd/jieling/netty/server/NettyGameServer.java index fb62959de..67fe3ddf1 100644 --- a/netty/src/main/java/com/ljsd/jieling/netty/server/NettyGameServer.java +++ b/netty/src/main/java/com/ljsd/jieling/netty/server/NettyGameServer.java @@ -136,8 +136,9 @@ public class NettyGameServer extends AbstractServer { } catch (Throwable var2) { LOGGER.error("close NettyChannel exception" + var2); } - bossGroup.shutdownGracefully(); - workerGroup.shutdownGracefully(); + //等待关闭网络 或者异步停留10秒 + bossGroup.shutdownGracefully().sync(); + workerGroup.shutdownGracefully().sync(); } catch (Exception e) { LOGGER.error("close exception", getLocalAddress()); }