use of org.ko.netty.t3.handler.HelloWordServerHandler in project tutorials-java by Artister.
the class ServerChannelInitializer method initChannel.
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
ChannelPipeline pipeline = socketChannel.pipeline();
// 字符串解码 和 编码
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
// 字符长度
pipeline.addLast(new LineBasedFrameDecoder(2048));
// 自己的逻辑Handler
pipeline.addLast("handler", new HelloWordServerHandler());
}
Aggregations