mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 01:03:01 +08:00
23 lines
748 B
C#
23 lines
748 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MQTTnet.Core.ManagedClient
|
|
{
|
|
public static class ManagedMqttClientExtensions
|
|
{
|
|
public static Task SubscribeAsync(this IManagedMqttClient managedClient, params TopicFilter[] topicFilters)
|
|
{
|
|
if (managedClient == null) throw new ArgumentNullException(nameof(managedClient));
|
|
|
|
return managedClient.SubscribeAsync(topicFilters);
|
|
}
|
|
|
|
public static Task UnsubscribeAsync(this IManagedMqttClient managedClient, params TopicFilter[] topicFilters)
|
|
{
|
|
if (managedClient == null) throw new ArgumentNullException(nameof(managedClient));
|
|
|
|
return managedClient.UnsubscribeAsync(topicFilters);
|
|
}
|
|
}
|
|
}
|