fix: 由于解析错误导致的无法通信的问题

This commit is contained in:
2025-07-17 14:11:24 +08:00
parent 56dcbf5caa
commit 1053d71d29
4 changed files with 99 additions and 107 deletions

View File

@@ -525,9 +525,9 @@ public class UDPClientPool
{
var bytes = udpDatas[i].Data;
var expectedLen = ((pkgList[i].Options.BurstLength + 1) * 4);
if ((bytes.Length - 4) != expectedLen)
return new(new Exception($"Expected {expectedLen} bytes but received {bytes.Length - 4} bytes at segment {i}"));
resultData.AddRange(bytes[4..]);
if ((bytes.Length - 8) != expectedLen)
return new(new Exception($"Expected {expectedLen} bytes but received {bytes.Length - 8} bytes at segment {i}"));
resultData.AddRange(bytes[8..]);
}
// Validate total data length