use of pers.cy.iris.commons.network.protocol.CommandEncoder in project iris by chicc999.
the class NettyTransport method handler.
protected ChannelHandler handler() {
return new ChannelInitializer() {
@Override
protected void initChannel(Channel ch) throws Exception {
ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(config.getFrameMaxSize(), 0, 4, 0, 4));
ch.pipeline().addLast(new CommandDecoder());
ch.pipeline().addLast(new CommandEncoder());
ch.pipeline().addLast(new IdleStateHandler(0, 0, config.getChannelMaxIdleTime(), TimeUnit.MILLISECONDS));
ch.pipeline().addLast(dispatcherHandler);
ch.pipeline().addLast(connectionHandler);
}
};
}
Aggregations