修复参数为ByteBuf造成的ClassCastException
parent
831970e042
commit
e0c9e1abf2
|
@ -31,7 +31,10 @@ public class MessageEncoderWrapper extends ChannelOutboundHandlerAdapter {
|
|||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {
|
||||
ByteBuf buf = null;
|
||||
try {
|
||||
buf = encoder.encode(msg);
|
||||
if (msg instanceof ByteBuf)
|
||||
buf = (ByteBuf) msg;
|
||||
else
|
||||
buf = encoder.encode(msg);
|
||||
if (log.isInfoEnabled())
|
||||
log.info("<<<<<原始报文[ip={}],hex={}", ctx.channel().remoteAddress(), ByteBufUtil.hexDump(buf));
|
||||
|
||||
|
|
Loading…
Reference in New Issue