public void TriggerInactive() { var handlers = InboundHandlers.Cast <IChannelHandler>().Union(OutboundHandlers); foreach (var item in handlers.Where(item => item.IsActivated)) { item.ChannelInactive(_ctx); } Logger.Debug("Channel {0} inactivated.", _channel); }
public void TriggerException(Exception cause) { Logger.Error("Exception occurred in pipeline: {0}", cause.ToString()); // first, notify all handlers foreach (var handler in InboundHandlers.Cast <IChannelHandler>().Union(OutboundHandlers)) { handler.ExceptionCaught(_ctx, cause); } // then, throw exception throw cause; }
private IInboundHandler GetNextInbound() { if (InboundHandlers.Count != 0) { if (_currentInbound == null) { _currentInbound = InboundHandlers.First.Value; } else { var node = InboundHandlers.Find(_currentInbound); if (node != null && node.Next != null) { _currentInbound = node.Next.Value; return(_currentInbound); } return(null); } return(_currentInbound); } return(null); }