Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

31 řádky
1.1 KiB

  1. using System;
  2. using System.Threading.Tasks;
  3. using MQTTnet.Core.Packets;
  4. namespace MQTTnet.Core.ManagedClient
  5. {
  6. public static class ManagedMqttClientExtensions
  7. {
  8. public static Task EnqueueAsync(this ManagedMqttClient managedClient, params MqttApplicationMessage[] applicationMessages)
  9. {
  10. if (managedClient == null) throw new ArgumentNullException(nameof(managedClient));
  11. return managedClient.EnqueueAsync(applicationMessages);
  12. }
  13. public static Task SubscribeAsync(this ManagedMqttClient managedClient, params TopicFilter[] topicFilters)
  14. {
  15. if (managedClient == null) throw new ArgumentNullException(nameof(managedClient));
  16. return managedClient.SubscribeAsync(topicFilters);
  17. }
  18. public static Task UnsubscribeAsync(this ManagedMqttClient managedClient, params TopicFilter[] topicFilters)
  19. {
  20. if (managedClient == null) throw new ArgumentNullException(nameof(managedClient));
  21. return managedClient.UnsubscribeAsync(topicFilters);
  22. }
  23. }
  24. }