goframe
goframe copied to clipboard
关于LengthFieldBasedFrame的困惑
我把example中的例子改成下面这样为啥就跑不通了呢?希望鸟哥解惑下
encoderConfig := goframe.EncoderConfig{
ByteOrder: binary.BigEndian,
LengthFieldLength: 2,
LengthAdjustment: -2,
LengthIncludesLengthFieldLength: false,
}
decoderConfig := goframe.DecoderConfig{
ByteOrder: binary.BigEndian,
LengthFieldOffset: 0,
LengthFieldLength: 2,
LengthAdjustment: -2,
InitialBytesToStrip: 0,
}
@supermario1990 你去看下源码怎么实现的就知道了