try to fix receive problems

This commit is contained in:
SikongJueluo 2025-04-14 21:50:51 +08:00
parent ae34cf6436
commit 5e2da17c28
No known key found for this signature in database
1 changed files with 5 additions and 2 deletions

View File

@ -162,7 +162,7 @@ public class UDPServer
isTimeout = timeleft >= TimeSpan.FromMilliseconds(timeout);
}
if (data == null)
if (data is null)
{
logger.Trace("Get nothing even after time out");
return Optional.None<UDPData>();
@ -194,6 +194,8 @@ public class UDPServer
if (udpData.ContainsKey(ipAddr))
{
data = udpData[ipAddr];
logger.Debug($"Find UDP Data Array: {data.ToString()}");
break;
}
}
@ -201,8 +203,9 @@ public class UDPServer
isTimeout = timeleft >= TimeSpan.FromMilliseconds(timeout);
}
if (data == null)
if (data is null)
{
logger.Trace("Get nothing even after time out");
return Optional.None<List<UDPData>>();
}
else