From d14402f8be251f25f735a6ff1541340ceee9c142 Mon Sep 17 00:00:00 2001 From: lijw Date: Thu, 13 Mar 2025 11:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E6=89=93=E5=8D=B0,=E9=81=BF=E5=85=8D=E5=86=85?= =?UTF-8?q?=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/inspect/tcpserver/tcp/MyDecoder.java | 6 +++--- .../java/com/inspect/tcpserver/tcp/NettyServerHandler.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/inspect/tcpserver/tcp/MyDecoder.java b/src/main/java/com/inspect/tcpserver/tcp/MyDecoder.java index fcf67d6..5b90738 100644 --- a/src/main/java/com/inspect/tcpserver/tcp/MyDecoder.java +++ b/src/main/java/com/inspect/tcpserver/tcp/MyDecoder.java @@ -29,8 +29,8 @@ public class MyDecoder extends ByteToMessageDecoder { } final String uuid = RandomStringUtils.randomAlphanumeric(16); - ByteBuf forPrint = in.copy(); - log.info("######## 会话: {}, 客户: {}, 上行原始报文 ######## \n {}", uuid, ctx.channel().id().asShortText(), ByteBufUtil.hexDump(forPrint)); +// ByteBuf forPrint = in.copy(); +// log.info("######## 会话: {}, 客户: {}, 上行原始报文 ######## \n {}", uuid, ctx.channel().id().asShortText(), ByteBufUtil.hexDump(forPrint)); int index; String flag; @@ -72,4 +72,4 @@ public class MyDecoder extends ByteToMessageDecoder { } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/inspect/tcpserver/tcp/NettyServerHandler.java b/src/main/java/com/inspect/tcpserver/tcp/NettyServerHandler.java index 122ecd4..3f7ece6 100644 --- a/src/main/java/com/inspect/tcpserver/tcp/NettyServerHandler.java +++ b/src/main/java/com/inspect/tcpserver/tcp/NettyServerHandler.java @@ -22,8 +22,8 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter { public void sendMsg(String uuid, String clientKey, String clientValue, ByteBuf byteBuf) { if (ids.containsKey(clientValue)) { - ByteBuf forPrint = byteBuf.copy(); - logger.info("######## 会话: {}, 客户键值: {}, 客户号: {}, 下行原始报文 ########\n [{}]", uuid, clientKey, clientValue, ByteBufUtil.hexDump(forPrint)); +// ByteBuf forPrint = byteBuf.copy(); +// logger.info("######## 会话: {}, 客户键值: {}, 客户号: {}, 下行原始报文 ########\n [{}]", uuid, clientKey, clientValue, ByteBufUtil.hexDump(forPrint)); ids.get(clientValue).writeAndFlush(byteBuf); } }