Exemplo n.º 1
0
        public static Task UnsubscribeAsync(this IMqttManagedClient managedClient, params string[] topicFilters)
        {
            if (managedClient == null)
            {
                throw new ArgumentNullException(nameof(managedClient));
            }

            return(managedClient.UnsubscribeAsync(topicFilters));
        }
Exemplo n.º 2
0
        public static Task SubscribeAsync(this IMqttManagedClient managedClient, string topic)
        {
            if (managedClient == null)
            {
                throw new ArgumentNullException(nameof(managedClient));
            }
            if (topic == null)
            {
                throw new ArgumentNullException(nameof(topic));
            }

            return(managedClient.SubscribeAsync(new TopicFilterBuilder().WithTopic(topic).Build()));
        }