NetMQ.Sockets.SubscriberSocket.Unsubscribe C# (CSharp) Method

Unsubscribe() public method

Remove this socket's subscription to the given topic.
public Unsubscribe ( byte topic ) : void
topic byte a byte-array denoting which the topic to stop receiving
return void
        public new virtual void Unsubscribe(byte[] topic)
        {
            SetSocketOption(ZmqSocketOption.Unsubscribe, topic);
        }
    }

Same methods

SubscriberSocket::Unsubscribe ( string topic ) : void
SubscriberSocket::Unsubscribe ( string topic, Encoding encoding ) : void

Usage Example

Esempio n. 1
0
        public void MultipleSubscriptions()
        {
            using (var pub = new PublisherSocket())
            using (var sub = new SubscriberSocket())
            {
                var port = pub.BindRandomPort("tcp://127.0.0.1");
                sub.Connect("tcp://127.0.0.1:" + port);
                sub.Subscribe("C");
                sub.Subscribe("B");
                sub.Subscribe("A");
                sub.Subscribe("D");
                sub.Subscribe("E");

                Thread.Sleep(500);

                sub.Unsubscribe("C");
                sub.Unsubscribe("B");
                sub.Unsubscribe("A");
                sub.Unsubscribe("D");
                sub.Unsubscribe("E");

                Thread.Sleep(500);
            }
        }
All Usage Examples Of NetMQ.Sockets.SubscriberSocket::Unsubscribe