MultithreadingDataAdapterTesterRunAsync 方法
异步执行模拟测试运行,发送指定的数据并统计处理时间。
命名空间: TouchSocket.Core程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
public Task<TimeSpan> RunAsync(
ReadOnlyMemory<byte> memory,
int testCount,
int expectedCount,
int millisecondsTimeout
)
Public Function RunAsync (
memory As ReadOnlyMemory(Of Byte),
testCount As Integer,
expectedCount As Integer,
millisecondsTimeout As Integer
) As Task(Of TimeSpan)
member RunAsync :
memory : ReadOnlyMemory<byte> *
testCount : int *
expectedCount : int *
millisecondsTimeout : int -> Task<TimeSpan>
- memory ReadOnlyMemoryByte
- 待测试的内存数据块,包含要发送的字节数据。
- testCount Int32
- 测试发送的总次数。
- expectedCount Int32
- 期望接收到的数据包数量,用于判断测试是否完成。
- millisecondsTimeout Int32
- 测试超时时间,单位为毫秒。如果在指定时间内未完成测试,将抛出超时异常。
TaskTimeSpan返回一个
TaskTResult,表示测试完成所用的时间。
该方法会启动计时器,发送指定次数的数据包,然后等待接收到期望数量的响应。
测试过程是异步的,支持高并发数据发送和处理。