MqttClientOptions.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using MQTTnet.Client.ExtendedAuthenticationExchange;
  2. using MQTTnet.Formatter;
  3. using MQTTnet.Packets;
  4. using System;
  5. using System.Collections.Generic;
  6. namespace MQTTnet.Client.Options
  7. {
  8. public class MqttClientOptions : IMqttClientOptions
  9. {
  10. public string ClientId { get; set; } = Guid.NewGuid().ToString("N");
  11. public bool CleanSession { get; set; } = true;
  12. public IMqttClientCredentials Credentials { get; set; }
  13. public IMqttExtendedAuthenticationExchangeHandler ExtendedAuthenticationExchangeHandler { get; set; }
  14. public MqttProtocolVersion ProtocolVersion { get; set; } = MqttProtocolVersion.V311;
  15. public IMqttClientChannelOptions ChannelOptions { get; set; }
  16. public TimeSpan CommunicationTimeout { get; set; } = TimeSpan.FromSeconds(10);
  17. public TimeSpan KeepAlivePeriod { get; set; } = TimeSpan.FromSeconds(15);
  18. public TimeSpan? KeepAliveSendInterval { get; set; }
  19. public MqttApplicationMessage WillMessage { get; set; }
  20. public uint? WillDelayInterval { get; set; }
  21. public string AuthenticationMethod { get; set; }
  22. public byte[] AuthenticationData { get; set; }
  23. public uint? MaximumPacketSize { get; set; }
  24. public ushort? ReceiveMaximum { get; set; }
  25. public bool? RequestProblemInformation { get; set; }
  26. public bool? RequestResponseInformation { get; set; }
  27. public uint? SessionExpiryInterval { get; set; }
  28. public ushort? TopicAliasMaximum { get; set; }
  29. public List<MqttUserProperty> UserProperties { get; set; }
  30. }
  31. }