25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
647 B

  1. using System;
  2. using System.Collections.Generic;
  3. using MQTTnet.Core.Adapter;
  4. using MQTTnet.Core.Diagnostics;
  5. using MQTTnet.Core.Server;
  6. using MQTTnet.Implementations;
  7. namespace MQTTnet
  8. {
  9. public class MqttServerFactory : IMqttServerFactory
  10. {
  11. public IMqttServer CreateMqttServer(MqttServerOptions options, IMqttNetTraceHandler traceHandler = null)
  12. {
  13. if (options == null) throw new ArgumentNullException(nameof(options));
  14. var trace = new MqttNetTrace(traceHandler);
  15. return new MqttServer(options, new List<IMqttServerAdapter> { new MqttServerAdapter(trace) }, trace);
  16. }
  17. }
  18. }