use of com.duangframework.rpc.common.NettyEncoder in project duangframework by tcrct.
the class RpcChannelInitializer method initChannel.
@Override
protected void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline p = ch.pipeline();
// 将 RPC 请求进行解码(为了处理请求)
p.addLast(new NettyDecoder());
// // 将 RPC 响应进行编码(为了返回响应)
p.addLast(new NettyEncoder());
// 目的是支持异步大文件传输
p.addLast(new ChunkedWriteHandler());
p.addLast(new IdleStateHandler(60, 0, 0));
// 真正处理RPC业务逻辑的地方
p.addLast(new NettyServiceHandler());
}
use of com.duangframework.rpc.common.NettyEncoder in project duangframework by tcrct.
the class ClientChannelInitializer method initChannel.
@Override
protected void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline p = ch.pipeline();
// 将 RPC 请求进行解码(为了处理请求)
p.addLast(new NettyDecoder());
// // 将 RPC 响应进行编码(为了返回响应)
p.addLast(new NettyEncoder());
// 目的是支持异步大文件传输
p.addLast(new ChunkedWriteHandler());
p.addLast(new IdleStateHandler(60, 0, 0));
// 真正处理RPC业务逻辑的地方
p.addLast(new NettyClientHandler());
}
Aggregations