public void Unsubscribe(UnsubscribePacket packet) { if (packet.PacketId == 0) { packet.PacketId = this.GetNextPacketId(); } Send(packet); }
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); }