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.
 
 
 
 

20 line
650 B

  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());
  16. }
  17. }
  18. }