use of org.ko.netty.t2.handler.HwClientHandler in project tutorials-java by Artister.
the class ClientChannelInitializer method initChannel.
protected void initChannel(SocketChannel socketChannel) throws Exception {
ChannelPipeline pipeline = socketChannel.pipeline();
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
// 客户端的handler
// 先调用handler在ChannnelActive方法中调用fireChannelActive会激活handler1
pipeline.addLast("handler", new HwClientHandler());
pipeline.addLast("handler1", new BaseClientHandler());
}
Aggregations