Пример #1
0
        public static void Unsubscribe(string topic)
        {
            Console.WriteLine("Unsubscribing from: " + topic);

            //broker.Unsubscribe( name, topic );
            //SubscriberDelegate del = new SubscriberDelegate( broker.Unsubscribe );
            SubscriberDelegate del            = new SubscriberDelegate(brokerCircle.Unsubscribe);
            AsyncCallback      remoteCallback = new AsyncCallback(SubscriberCallback);
            IAsyncResult       remAr          = del.BeginInvoke(name, topic, remoteCallback, null);

            Subscriber.topics.Remove(topic);
        }
Пример #2
0
        public static void Subscribe(string topic)
        {
            // Console.WriteLine( "Subscribing to: " + topic );

            //broker.Subscribe( name, topic );

            // No replication
            //SubscriberDelegate del = new SubscriberDelegate( broker.Subscribe );

            // Replication
            SubscriberDelegate del = new SubscriberDelegate(brokerCircle.Subscribe);

            AsyncCallback remoteCallback = new AsyncCallback(SubscriberCallback);
            IAsyncResult  remAr          = del.BeginInvoke(name, topic, remoteCallback, null);

            Subscriber.topics.Add(topic);
        }
Пример #3
0
        public static void Unsubscribe( string topic )
        {
            Console.WriteLine( "Unsubscribing from: " + topic );

            //broker.Unsubscribe( name, topic );
            //SubscriberDelegate del = new SubscriberDelegate( broker.Unsubscribe );
            SubscriberDelegate del = new SubscriberDelegate( brokerCircle.Unsubscribe );
            AsyncCallback remoteCallback = new AsyncCallback( SubscriberCallback );
            IAsyncResult remAr = del.BeginInvoke( name, topic, remoteCallback, null );

            Subscriber.topics.Remove(topic);
        }
Пример #4
0
        public static void Subscribe( string topic )
        {
            // Console.WriteLine( "Subscribing to: " + topic );

            //broker.Subscribe( name, topic );

            // No replication
            //SubscriberDelegate del = new SubscriberDelegate( broker.Subscribe );

            // Replication
            SubscriberDelegate del = new SubscriberDelegate( brokerCircle.Subscribe );

            AsyncCallback remoteCallback = new AsyncCallback( SubscriberCallback );
            IAsyncResult remAr = del.BeginInvoke( name, topic, remoteCallback, null );

            Subscriber.topics.Add(topic);
        }