Search in sources :

Example 1 with SimpleChannelId

use of io.dingodb.net.netty.channel.impl.SimpleChannelId in project dingo by dingodb.

the class MessageDecoder method readChannelId.

private static ChannelId readChannelId(ByteBuf buf) {
    Integer len = Serializers.readVarInt(buf);
    if (len == null) {
        throw new CorruptedFrameException("Invalid channel id len: null.");
    }
    if (len == 0) {
        return null;
    }
    byte[] bytes = new byte[len];
    buf.readBytes(bytes);
    return new SimpleChannelId().load(bytes);
}
Also used : CorruptedFrameException(io.netty.handler.codec.CorruptedFrameException) SimpleChannelId(io.dingodb.net.netty.channel.impl.SimpleChannelId)

Aggregations

SimpleChannelId (io.dingodb.net.netty.channel.impl.SimpleChannelId)1 CorruptedFrameException (io.netty.handler.codec.CorruptedFrameException)1