Пример #1
0
        /// <summary>
        /// Pipe connection event handler.
        /// </summary>
        /// <param name="evt">Pipe connection event.</param>
        public void OnPipeConnectionEvent(PipeConnectionEvent evt)
        {
            switch (evt.Type)
            {
            case PipeConnectionEvent.PROVIDER_CONNECT_PUSH:
                if (evt.Provider == this && evt.Source != _connMsgOut && (evt.ParameterMap == null || !evt.ParameterMap.ContainsKey("record")))
                {
                    _livePipe = evt.Source as IPipe;
                    foreach (IConsumer consumer in _livePipe.GetConsumers())
                    {
                        _subscriberStats.Increment();
                    }
                }
                break;

            case PipeConnectionEvent.PROVIDER_DISCONNECT:
                if (_livePipe == evt.Source)
                {
                    _livePipe = null;
                }
                break;

            case PipeConnectionEvent.CONSUMER_CONNECT_PUSH:
                if (_livePipe == evt.Source)
                {
                    NotifyChunkSize();
                }
                _subscriberStats.Increment();
                break;

            case PipeConnectionEvent.CONSUMER_DISCONNECT:
                _subscriberStats.Decrement();
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// Pipe connection event handler.
 /// </summary>
 /// <param name="evt">Pipe connection event.</param>
 public void OnPipeConnectionEvent(PipeConnectionEvent evt)
 {
     switch (evt.Type)
     {
         case PipeConnectionEvent.PROVIDER_CONNECT_PUSH:
             if (evt.Provider == this && evt.Source != _connMsgOut && (evt.ParameterMap == null || !evt.ParameterMap.ContainsKey("record")))
             {
                 _livePipe = evt.Source as IPipe;
                 foreach (IConsumer consumer in _livePipe.GetConsumers())
                 {
                     _subscriberStats.Increment();
                 }
             }
             break;
         case PipeConnectionEvent.PROVIDER_DISCONNECT:
             if (_livePipe == evt.Source)
             {
                 _livePipe = null;
             }
             break;
         case PipeConnectionEvent.CONSUMER_CONNECT_PUSH:
             if (_livePipe == evt.Source)
             {
                 NotifyChunkSize();
             }
             _subscriberStats.Increment();
             break;
         case PipeConnectionEvent.CONSUMER_DISCONNECT:
             _subscriberStats.Decrement();
             break;
         default:
             break;
     }
 }