From 767c710e84377c53d345180961e6d607fdc29e15 Mon Sep 17 00:00:00 2001 From: odboy Date: Fri, 6 Dec 2024 21:57:21 +0800 Subject: [PATCH] =?UTF-8?q?upd:=20=E6=97=A5=E5=BF=97=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/odboy/config/netty/ConfigClientHandler.java | 11 +++++++---- .../cn/odboy/infra/netty/ConfigServerHandler.java | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kenaito-config-core/src/main/java/cn/odboy/config/netty/ConfigClientHandler.java b/kenaito-config-core/src/main/java/cn/odboy/config/netty/ConfigClientHandler.java index 2a1e30e..12daea3 100644 --- a/kenaito-config-core/src/main/java/cn/odboy/config/netty/ConfigClientHandler.java +++ b/kenaito-config-core/src/main/java/cn/odboy/config/netty/ConfigClientHandler.java @@ -29,17 +29,19 @@ public class ConfigClientHandler extends ChannelInboundHandlerAdapter { @Override public void channelRegistered(ChannelHandlerContext ctx) throws Exception { - logger.info("当Channel已经注册到它的EventLoop并且能够处理I/O时被调用"); + /// logger.info("当Channel已经注册到它的EventLoop并且能够处理I/O时被调用"); + super.channelRegistered(ctx); } @Override public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { - logger.info("当Channel从它的EventLoop注销并且无法处理任何I/O时被调用"); + /// logger.info("当Channel从它的EventLoop注销并且无法处理任何I/O时被调用"); + super.channelUnregistered(ctx); } @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { - logger.info("当Channel处于活动状态(已经连接到它的远程节点)时被调用, 注册客户端"); + /// logger.info("当Channel处于活动状态(已经连接到它的远程节点)时被调用, 注册客户端"); SmallMessage smallMessage = new SmallMessage(); smallMessage.setType(TransferMessageType.REGISTER); smallMessage.setResp(SmallMessage.Response.ok(ClientConfigLoader.clientInfo)); @@ -48,8 +50,9 @@ public class ConfigClientHandler extends ChannelInboundHandlerAdapter { @Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { - logger.info("当Channel离开活动状态并且不再连接到它的远程节点时被调用"); + /// logger.info("当Channel离开活动状态并且不再连接到它的远程节点时被调用"); /// this.configClient.reConnect(); + super.channelInactive(ctx); } @Override diff --git a/kenaito-config-service/src/main/java/cn/odboy/infra/netty/ConfigServerHandler.java b/kenaito-config-service/src/main/java/cn/odboy/infra/netty/ConfigServerHandler.java index 404ea3e..f235c43 100644 --- a/kenaito-config-service/src/main/java/cn/odboy/infra/netty/ConfigServerHandler.java +++ b/kenaito-config-service/src/main/java/cn/odboy/infra/netty/ConfigServerHandler.java @@ -109,7 +109,7 @@ public class ConfigServerHandler extends ChannelInboundHandlerAdapter { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - log.error("当Channel发生异常被调用", cause); + log.error("Channel发生异常", cause); /// cause.printStackTrace(); ConfigClientManage.unregister(ctx.channel().id()); ctx.close(); @@ -117,13 +117,13 @@ public class ConfigServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelInactive(ChannelHandlerContext ctx) throws Exception { - log.info("当Channel处于非活动状态(已经连接到它的远程节点)时被调用"); + /// log.info("当Channel处于非活动状态(已经连接到它的远程节点)时被调用"); ConfigClientManage.unregister(ctx.channel().id()); } @Override public void channelUnregistered(ChannelHandlerContext ctx) throws Exception { - log.info("当Channel从它的EventLoop注销并且不能够处理I/O时被调用"); + /// log.info("当Channel从它的EventLoop注销并且不能够处理I/O时被调用"); ConfigClientManage.unregister(ctx.channel().id()); } }