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());
         }
     }
 }
Exemple #2
0
 public override void ChannelInactive(IChannelHandlerContext context)
 {
     _listener.OnSessionEnd(context.Channel.Id.AsLongText());
 }