您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MqttFactoryExtensions.cs 419 B

1234567891011121314
  1. using System;
  2. namespace MQTTnet.Extensions.WebSocket4Net
  3. {
  4. public static class MqttFactoryExtensions
  5. {
  6. public static IMqttFactory UseWebSocket4Net(this IMqttFactory mqttFactory)
  7. {
  8. if (mqttFactory == null) throw new ArgumentNullException(nameof(mqttFactory));
  9. return mqttFactory.UseClientAdapterFactory(new WebSocket4NetMqttClientAdapterFactory());
  10. }
  11. }
  12. }