MemoryPacketSource
Ecng.Net
In-memory packet source for testing.
实现: IUdpPacketSource
构造函数
MemoryPacketSource
public MemoryPacketSource(IReadOnlyList<ValueTuple<IPEndPoint, byte[], DateTime>> packets)
memoryPacketSource = MemoryPacketSource(packets)
In-memory packet source for testing.
- packets
- The packets to provide.
方法
GetPacketsAsync
public IAsyncEnumerable<ValueTuple<IPEndPoint, Memory<byte>, DateTime>> GetPacketsAsync()
result = memoryPacketSource.GetPacketsAsync()
Gets packets asynchronously.
返回值: Async enumerable of packets with endpoint, payload, and timestamp.