Search in sources :

Example 1 with HwServerHandler

use of org.ko.netty.t2.handler.HwServerHandler 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());
    // 自己的逻辑Handler
    pipeline.addLast("handler", new HwServerHandler());
}
Also used : StringEncoder(io.netty.handler.codec.string.StringEncoder) HwServerHandler(org.ko.netty.t2.handler.HwServerHandler) StringDecoder(io.netty.handler.codec.string.StringDecoder) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

ChannelPipeline (io.netty.channel.ChannelPipeline)1 StringDecoder (io.netty.handler.codec.string.StringDecoder)1 StringEncoder (io.netty.handler.codec.string.StringEncoder)1 HwServerHandler (org.ko.netty.t2.handler.HwServerHandler)1