private void ReceiveFrameProcessRequests(Socket inHandler) { while (true) { var frameRangeToProcess = NT.ReceiveIntCollections(inHandler); if (frameRangeToProcess.receivedSuccessfully) { foreach (var arr in frameRangeToProcess.collections) { _engine.IdentifyDifferences(arr); } } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Frame range to process count: {frameRangeToProcess.collections.Count}"); Console.ResetColor(); break; } // Process data for frame range var processedData = _engine.GetDifferenceBlocks(); // Send processed results back to server NT.SendIntCollections(inHandler, processedData); } }
private void IssueClientFrameProcessRequests(Socket inHandler) { while (true) { var nextFrameRange = GetNextFrameRange(); // If there are no more frames to process, exit loop allow connections to be closed if (nextFrameRange.Length == 0) { // Send frame indices to be processed NT.SendInt(inHandler, 0); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Frames left to process: {nextFrameRange.Length}"); Console.ResetColor(); break; } NT.SendIntCollections(inHandler, nextFrameRange); // Receive processed frame data var processOutput = NT.ReceiveIntCollections(inHandler); // Save process output to database SaveFrameBlocks(processOutput.collections); } }