use of pers.cy.iris.commons.network.protocol.request.HeartBeat in project iris by chicc999.
the class DefaultConnectionHandler method userEventTriggered.
@Override
public void userEventTriggered(final ChannelHandlerContext ctx, final Object evt) throws Exception {
if (evt instanceof IdleStateEvent) {
IdleStateEvent event = (IdleStateEvent) evt;
if (event.state().equals(IdleState.ALL_IDLE)) {
logger.debug("channel {} is idle.", ctx.channel());
ctx.writeAndFlush(new HeartBeat()).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
}
}
super.userEventTriggered(ctx, evt);
}
Aggregations