You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MqttClientFactory.cs 662 B

7 年之前
7 年之前
7 年之前
7 年之前
7 年之前
7 年之前
1234567891011121314151617181920
  1. using MQTTnet.Core.Client;
  2. using MQTTnet.Core.Diagnostics;
  3. using MQTTnet.Core.ManagedClient;
  4. using MQTTnet.Implementations;
  5. namespace MQTTnet
  6. {
  7. public class MqttClientFactory : IMqttClientFactory
  8. {
  9. public IMqttClient CreateMqttClient(IMqttNetTraceHandler traceHandler = null)
  10. {
  11. return new MqttClient(new MqttCommunicationAdapterFactory(), new MqttNetTrace(traceHandler));
  12. }
  13. public ManagedMqttClient CreateManagedMqttClient(IMqttNetTraceHandler traceHandler = null)
  14. {
  15. return new ManagedMqttClient(new MqttCommunicationAdapterFactory(), new MqttNetTrace(traceHandler));
  16. }
  17. }
  18. }