MemoryPacketSource
Ecng.Net
In-memory packet source for testing.
Implements: IUdpPacketSource
Constructors
MemoryPacketSource
public MemoryPacketSource(IReadOnlyList<ValueTuple<IPEndPoint, byte[], DateTime>> packets)
memoryPacketSource = MemoryPacketSource(packets)
In-memory packet source for testing.
- packets
- The packets to provide.
Methods
GetPacketsAsync
public IAsyncEnumerable<ValueTuple<IPEndPoint, Memory<byte>, DateTime>> GetPacketsAsync()
result = memoryPacketSource.GetPacketsAsync()
Gets packets asynchronously.
Returns: Async enumerable of packets with endpoint, payload, and timestamp.