27 lines
743 B
Java
27 lines
743 B
Java
package network.client;
|
|
|
|
import com.ljsd.jieling.netty.cocdex.ByteBufDecoder;
|
|
import com.ljsd.jieling.netty.cocdex.ByteBufEncoder;
|
|
import com.ljsd.jieling.netty.cocdex.TeaDecoder;
|
|
import com.ljsd.jieling.netty.cocdex.TeaEncoder;
|
|
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<SocketChannel>{
|
|
|
|
|
|
@Override
|
|
protected void initChannel(SocketChannel ch) throws Exception {
|
|
|
|
ChannelPipeline p = ch.pipeline();
|
|
p.addLast(new TeaDecoder());
|
|
p.addLast(new TeaEncoder());
|
|
p.addLast(new NettyTCPClientHandler());
|
|
}
|
|
}
|