コード例 #1
0
ファイル: PipelineSession.cs プロジェクト: lanicon/TomP2P.NET
        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);
        }
コード例 #2
0
ファイル: PipelineSession.cs プロジェクト: lanicon/TomP2P.NET
 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;
 }
コード例 #3
0
ファイル: PipelineSession.cs プロジェクト: lanicon/TomP2P.NET
 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);
 }