Ejemplo n.º 1
0
        private NotificationDeliveryServiceProxy CreateListener(ConnectionInfo connectionInfo)
        {
            if (connectionInfo.SupportsActiveSubscriptions)
            {
                var proxy = connectionInfo.CreateActiveListenerProxy(this);
                proxy.Open();
                proxy.InnerChannel.Faulted += (x, y) => ChannelFaulted(connectionInfo);
                proxy.InnerChannel.Closed  += (x, y) => ChannelClosed(connectionInfo);

                proxy.ReceiveIndications(_activeSubscriberAddress);
                return(proxy);
            }
            else
            {
                if (!_subscriptionListener.IsListening())
                {
                    _subscriptionListener.OpenSubscriber();
                }
            }

            return(null);
        }