mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 00:15:15 +08:00
25 lines
581 B
C#
25 lines
581 B
C#
using System;
|
|
using System.IO;
|
|
using MQTTnet.Packets;
|
|
|
|
namespace MQTTnet.Adapter
|
|
{
|
|
public sealed class ReceivedMqttPacket : IDisposable
|
|
{
|
|
public ReceivedMqttPacket(MqttPacketHeader header, MemoryStream body)
|
|
{
|
|
Header = header ?? throw new ArgumentNullException(nameof(header));
|
|
Body = body ?? throw new ArgumentNullException(nameof(body));
|
|
}
|
|
|
|
public MqttPacketHeader Header { get; }
|
|
|
|
public MemoryStream Body { get; }
|
|
|
|
public void Dispose()
|
|
{
|
|
Body?.Dispose();
|
|
}
|
|
}
|
|
}
|