use of io.dingodb.net.netty.packet.Header in project dingo by dingodb.
the class MessageDecoder method decode.
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
if (!ctx.channel().isOpen()) {
if (in.readableBytes() > 0) {
log.info("Channel is closed, discarding remaining {} byte(s) in buffer.", in.readableBytes());
}
in.skipBytes(in.readableBytes());
return;
}
ByteBuf messageBuf = readMessageBuf(in);
if (messageBuf == null) {
return;
}
Header header = readHeader(messageBuf);
Message message = readMessage(messageBuf);
out.add(new MessagePacket(header, message));
messageBuf.release();
}
Aggregations