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.
 
 
 
 

25 line
581 B

  1. using System;
  2. using System.IO;
  3. using MQTTnet.Packets;
  4. namespace MQTTnet.Adapter
  5. {
  6. public sealed class ReceivedMqttPacket : IDisposable
  7. {
  8. public ReceivedMqttPacket(MqttPacketHeader header, MemoryStream body)
  9. {
  10. Header = header ?? throw new ArgumentNullException(nameof(header));
  11. Body = body ?? throw new ArgumentNullException(nameof(body));
  12. }
  13. public MqttPacketHeader Header { get; }
  14. public MemoryStream Body { get; }
  15. public void Dispose()
  16. {
  17. Body?.Dispose();
  18. }
  19. }
  20. }