Browse Source

/*增加发送完整日志信息。*/

master
htjcAdmin 9 months ago
parent
commit
802420fc1d
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/main/java/com/inspect/tcpserver/tcp/NettyServerHandler.java

+ 3
- 0
src/main/java/com/inspect/tcpserver/tcp/NettyServerHandler.java View File

@ -1,6 +1,7 @@
package com.inspect.tcpserver.tcp; package com.inspect.tcpserver.tcp;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelInboundHandlerAdapter;
import org.apache.tomcat.util.buf.HexUtils; import org.apache.tomcat.util.buf.HexUtils;
@ -22,6 +23,8 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
public void SendMsg(String id, ByteBuf byteBuf) { public void SendMsg(String id, ByteBuf byteBuf) {
if (ids.containsKey(id)) { if (ids.containsKey(id)) {
ByteBuf forPrint = byteBuf.copy();
logger.info("[NETTY] FULL MSG =>: [{}]", ByteBufUtil.hexDump(forPrint));
ids.get(id).writeAndFlush(byteBuf); ids.get(id).writeAndFlush(byteBuf);
} }
} }


Loading…
Cancel
Save