|
@@ -79,8 +79,8 @@ public class GroupNettyClient {
|
|
|
.handler(new ChannelInitializer<SocketChannel>() {
|
|
|
@Override
|
|
|
protected void initChannel(SocketChannel ch) throws Exception {
|
|
|
- ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 6, 0, 6));
|
|
|
- ch.pipeline().addLast(new LengthFieldPrepender(6));
|
|
|
+ ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 8, 0, 8));
|
|
|
+ ch.pipeline().addLast(new LengthFieldPrepender(8));
|
|
|
// 将分隔之后的字节数据转换为字符串
|
|
|
ch.pipeline().addLast(new StringDecoder());
|
|
|
ch.pipeline().addLast(new StringEncoder());
|