Beispiel #1
0
        // unsubscribes a client to a channel
        public void unsubscribe_channel(string[] message)
        {
            // extract subscription(s) requested
            unsubscribe u = new unsubscribe(message);

            // pubsub enabled
            if (protocol.pubsub != null)
            {
                // call the dynamic unsubscription builder
                protocol.Unsubscribe(u.channel_name_or_uri);

                // unsubscribe the client to this channel
                if (subscriptions != null)
                    subscriptions.RemoveAll(s => s.channel_name_or_uri == u.channel_name_or_uri);
            }
        }
Beispiel #2
0
        public void unsubscribe()
        {
            // documentation example 1
            string input = "[14,\"\\/rss\\/news\\/latest\"]";
            string[] message = JSONDecoders.DecodeJSONArray(input);
            Assert.AreEqual(message[0], "14");

            unsubscribe u = new unsubscribe(message);
            Assert.AreEqual(u.channel_name_or_uri, "/rss/news/latest");
        }