diff --git a/rpt-client/src/main/java/cn/promptness/rpt/client/handler/LocalHandler.java b/rpt-client/src/main/java/cn/promptness/rpt/client/handler/LocalHandler.java index b7fd0f2..083dc0f 100644 --- a/rpt-client/src/main/java/cn/promptness/rpt/client/handler/LocalHandler.java +++ b/rpt-client/src/main/java/cn/promptness/rpt/client/handler/LocalHandler.java @@ -47,6 +47,7 @@ protected void channelRead0(ChannelHandlerContext ctx, byte[] bytes) throws Exce @Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { ctx.channel().config().setAutoRead(true); + channel.config().setAutoRead(true); send(MessageType.TYPE_DISCONNECTED, EmptyArrays.EMPTY_BYTES); } diff --git a/rpt-server/src/main/java/cn/promptness/rpt/server/handler/RemoteHandler.java b/rpt-server/src/main/java/cn/promptness/rpt/server/handler/RemoteHandler.java index ecdfdcd..1157d46 100644 --- a/rpt-server/src/main/java/cn/promptness/rpt/server/handler/RemoteHandler.java +++ b/rpt-server/src/main/java/cn/promptness/rpt/server/handler/RemoteHandler.java @@ -61,6 +61,7 @@ protected void channelRead0(ChannelHandlerContext ctx, byte[] bytes) throws Exce @Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { ctx.channel().config().setAutoRead(true); + channel.config().setAutoRead(true); send(MessageType.TYPE_DISCONNECTED, EmptyArrays.EMPTY_BYTES, ctx); } diff --git a/rpt-server/src/main/java/cn/promptness/rpt/server/handler/RequestHandler.java b/rpt-server/src/main/java/cn/promptness/rpt/server/handler/RequestHandler.java index d462272..f02b1d3 100644 --- a/rpt-server/src/main/java/cn/promptness/rpt/server/handler/RequestHandler.java +++ b/rpt-server/src/main/java/cn/promptness/rpt/server/handler/RequestHandler.java @@ -78,6 +78,7 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception { if (serverChannel == null) { return; } + serverChannel.config().setAutoRead(true); send(serverChannel, ctx, domain, MessageType.TYPE_DISCONNECTED, EmptyArrays.EMPTY_BYTES); } diff --git a/rpt-server/src/main/java/cn/promptness/rpt/server/handler/ServerHandler.java b/rpt-server/src/main/java/cn/promptness/rpt/server/handler/ServerHandler.java index 25124cb..c4d1bba 100644 --- a/rpt-server/src/main/java/cn/promptness/rpt/server/handler/ServerHandler.java +++ b/rpt-server/src/main/java/cn/promptness/rpt/server/handler/ServerHandler.java @@ -80,6 +80,9 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception { } } domainList.clear(); + for (Channel channel : ServerChannelCache.getServerHttpChannelMap().values()) { + channel.config().setAutoRead(true); + } }