package network.client; import com.ljsd.jieling.netty.cocdex.ByteBufDecoder; import com.ljsd.jieling.netty.cocdex.ByteBufEncoder; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; /** * Created by justin on 14-8-12. */ public class NettyTCPClientInitializer extends ChannelInitializer{ @Override protected void initChannel(SocketChannel ch) throws Exception { ChannelPipeline p = ch.pipeline(); p.addLast(new ByteBufDecoder()); p.addLast(new ByteBufEncoder()); p.addLast(new NettyTCPClientHandler()); } }