This commit is contained in:
2023-06-19 15:58:30 +08:00
parent 7f4718e238
commit 78cd8d1069

View File

@@ -25,10 +25,7 @@ public class StartAndLengthFieldFrameDecoder extends ByteToMessageDecoder {
public final int BASE_LENGTH = 1 + 1;
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer,
List<Object> out) throws Exception {
// System.out.println();
// log.info("打印ByteBuf:{}", buffer.toString());
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer, List<Object> out) throws Exception {
// 可读长度必须大于基本长度
if (buffer.readableBytes() <= BASE_LENGTH) {
log.warn("可读字节数:{}小于基础长度:{}", buffer.readableBytes(), BASE_LENGTH);