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

MqttApplicationMessage.cs 719 B

123456789101112131415161718192021222324
  1. using System;
  2. using MQTTnet.Core.Protocol;
  3. namespace MQTTnet.Core
  4. {
  5. public sealed class MqttApplicationMessage
  6. {
  7. public MqttApplicationMessage(string topic, byte[] payload, MqttQualityOfServiceLevel qualityOfServiceLevel, bool retain)
  8. {
  9. Topic = topic ?? throw new ArgumentNullException(nameof(topic));
  10. Payload = payload ?? throw new ArgumentNullException(nameof(payload));
  11. QualityOfServiceLevel = qualityOfServiceLevel;
  12. Retain = retain;
  13. }
  14. public string Topic { get; }
  15. public byte[] Payload { get; }
  16. public MqttQualityOfServiceLevel QualityOfServiceLevel { get; }
  17. public bool Retain { get; }
  18. }
  19. }