maybe fix bug: download bitstream failed

This commit is contained in:
2025-04-23 20:22:49 +08:00
parent 5ea541ef4b
commit 4e752d4c9e
5 changed files with 229 additions and 54 deletions

View File

@@ -116,6 +116,7 @@ public class UDPServer
/// </summary>
/// <param name="ipAddr"> 目标IP地址 </param>
/// <param name="timeout">超时时间</param>
/// <param name="cycle">延迟时间</param>
/// <param name="callerName">调用函数名称</param>
/// <param name="callerLineNum">调用函数位置</param>
/// <returns>
@@ -124,7 +125,7 @@ public class UDPServer
/// Optional 存在时,为最先收到的数据
/// </returns>
public async ValueTask<Optional<UDPData>> FindDataAsync(
string ipAddr, int timeout = 1000,
string ipAddr, int timeout = 1000, int cycle = 0,
[CallerMemberName] string callerName = "",
[CallerLineNumber] int callerLineNum = 0)
{
@@ -153,6 +154,8 @@ public class UDPServer
break;
}
}
await Task.Delay(cycle);
}
if (data is null)
@@ -171,8 +174,9 @@ public class UDPServer
/// </summary>
/// <param name="ipAddr">IP地址</param>
/// <param name="timeout">超时时间</param>
/// <param name="cycle">延迟时间</param>
/// <returns>数据列表</returns>
public async ValueTask<Optional<List<UDPData>>> GetDataArrayAsync(string ipAddr, int timeout = 1000)
public async ValueTask<Optional<List<UDPData>>> GetDataArrayAsync(string ipAddr, int timeout = 1000, int cycle = 0)
{
List<UDPData>? data = null;