Exemple #1
0
        public void Unsubscribe(UnsubscribePacket packet)
        {
            if (packet.PacketId == 0)
            {
                packet.PacketId = this.GetNextPacketId();
            }

            Send(packet);
        }
Exemple #2
0
        public void Unsubscribe(string[] topics)
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException("MqttConnection");
            }
            else if (!IsConnected)
            {
                throw new InvalidOperationException("Not connected");
            }

            UnsubscribePacket packet = new UnsubscribePacket()
            {
                Topics = topics
            };

            if (packet.PacketId == 0)
            {
                packet.PacketId = this.GetNextPacketId();
            }

            Send(packet);
        }