use of com.ctrip.xpipe.netty.ByteBufReadActionException in project x-pipe by ctripcorp.
the class NettySlaveHandler method doChannelRead.
@Override
protected void doChannelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
ByteBuf byteBuf = (ByteBuf) msg;
byteBufReadPolicy.read(ctx.channel(), byteBuf, new ByteBufReadAction() {
@Override
public void read(Channel channel, ByteBuf byteBuf) throws ByteBufReadActionException {
try {
redisMasterReplication.handleResponse(channel, byteBuf);
} catch (XpipeException e) {
throw new ByteBufReadActionException("handle:" + channel, e);
}
}
});
}
use of com.ctrip.xpipe.netty.ByteBufReadActionException in project x-pipe by ctripcorp.
the class NettyClientHandler method channelRead.
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
ByteBuf byteBuf = (ByteBuf) msg;
final NettyClient nettyClient = ctx.channel().attr(KEY_CLIENT).get();
byteBufReadPolicy.read(ctx.channel(), byteBuf, new ByteBufReadAction() {
@Override
public void read(Channel channel, ByteBuf byteBuf) throws ByteBufReadActionException {
nettyClient.handleResponse(channel, byteBuf);
}
});
super.channelRead(ctx, msg);
}
Aggregations