xin.alum.aim.coder.ProtoDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aim-starter Show documentation
Show all versions of aim-starter Show documentation
aim-starter 基于netty的WebSocket和Socket通信包
package xin.alum.aim.coder;
import io.netty.util.ReferenceCountUtil;
import xin.alum.aim.config.DataAgreement;
import xin.alum.aim.constant.ChannelAttr;
import xin.alum.aim.model.Sent;
import xin.alum.aim.model.proto.SentProto;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
import io.netty.handler.codec.protobuf.ProtobufDecoder;
import java.util.ArrayList;
import java.util.List;
/**
* Protobuf 协议转换
*
* @auther Alum(alum @ live.cn)
* @date 2021/8/5 17:05
*/
public class ProtoDecoder extends ProtobufDecoder {
public ProtoDecoder() {
super(SentProto.Model.getDefaultInstance());
}
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List