Ejemplo n.º 1
0
        protected virtual void RaiseSubscriptionAdded(RemoteWampTopicSubscriber subscriber, SubscribeOptions options)
        {
            EventHandler <WampSubscriptionAddEventArgs> handler = SubscriptionAdded;

            if (handler != null)
            {
                WampSubscriptionAddEventArgs args = GetAddEventArgs(subscriber, options);

                handler(this, args);
            }
        }
Ejemplo n.º 2
0
        public void Subscribe(ISubscribeRequest <TMessage> request, SubscribeOptions options)
        {
            RemoteWampTopicSubscriber remoteSubscriber =
                new RemoteWampTopicSubscriber(this.SubscriptionId,
                                              request.Client as IWampSubscriber);

            IWampClientProxy <TMessage> client = request.Client;

            RemoteObserver observer = mSubscriberBook.Subscribe(client);

            if (!observer.IsOpen)
            {
                this.RaiseSubscriptionAdding(remoteSubscriber, options);
            }

            request.Subscribed(this.SubscriptionId);

            if (!observer.IsOpen)
            {
                observer.Open();

                this.RaiseSubscriptionAdded(remoteSubscriber, options);
            }
        }
Ejemplo n.º 3
0
 private WampSubscriptionAddEventArgs GetAddEventArgs(RemoteWampTopicSubscriber subscriber, SubscribeOptions options)
 {
     return(new WampSubscriptionAddEventArgs(subscriber, options));
 }