Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }