update decoder改名

This commit is contained in:
Guoqs
2024-11-27 09:19:41 +08:00
parent 88b8339e22
commit 9b95a07d8b
4 changed files with 280 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
package com.jsowell.netty.server.electricbicycles;
import com.jsowell.netty.decoder.StartAndLengthFieldFrameDecoder;
import com.jsowell.netty.decoder.YouDianDecoder;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
@@ -20,7 +20,7 @@ public class ElectricBicyclesServerChannelInitializer extends ChannelInitializer
@Override
protected void initChannel(SocketChannel channel) throws Exception {
ChannelPipeline pipeline = channel.pipeline();
pipeline.addLast("frameDecoder", new StartAndLengthFieldFrameDecoder());
pipeline.addLast("frameDecoder", new YouDianDecoder());
// pipeline.addLast("decoder", new MessageDecode());
// pipeline.addLast("encoder", new MessageEncode());
pipeline.addLast("decoder", new ByteArrayDecoder());