feat: 部分修复摄像头批量读逻辑
This commit is contained in:
@@ -367,15 +367,17 @@ public class UDPServer
|
||||
|
||||
return retPack.Value;
|
||||
}
|
||||
static int ReceiveHandleCcount = 0;
|
||||
|
||||
private void ReceiveHandler(IAsyncResult res)
|
||||
{
|
||||
logger.Trace("Enter handler");
|
||||
var remoteEP = new IPEndPoint(IPAddress.Any, listenPort);
|
||||
byte[] bytes = listener.EndReceive(res, ref remoteEP);
|
||||
|
||||
// 提前开始接收下一个包
|
||||
listener.BeginReceive(new AsyncCallback(ReceiveHandler), null);
|
||||
logger.Debug($"Test ReceiveHandler Count = {ReceiveHandleCcount}");
|
||||
ReceiveHandleCcount++;
|
||||
|
||||
// Handle RemoteEP
|
||||
if (remoteEP is null)
|
||||
@@ -431,7 +433,7 @@ public class UDPServer
|
||||
udpData.TryGetValue($"{remoteAddress}-{taskID}", out var dataQueue))
|
||||
{
|
||||
dataQueue.Enqueue(data);
|
||||
logger.Trace("Receive data from old client");
|
||||
logger.Debug($"Test Lock dataQueue.Count = {dataQueue.Count}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user