public override void UserEventTriggered(IChannelHandlerContext context, object evt) { if (evt is IdleStateEvent e) { if (e.State == IdleState.WriterIdle) { context.WriteAndFlushAsync(new ServerHeartbeat()); } else if (e.State == IdleState.ReaderIdle) { context.CloseAsync(); _listener.OnSessionEnd(context.Channel.Id.AsLongText()); } } }
public override void ChannelInactive(IChannelHandlerContext context) { _listener.OnSessionEnd(context.Channel.Id.AsLongText()); }