IoUringAsmEngn: Use pcloudDataSocket from UdpCmdDemux

This commit is contained in:
2025-11-01 23:01:11 -04:00
parent 5845f1a41d
commit 14b97a52ed
3 changed files with 12 additions and 7 deletions
@@ -3,6 +3,7 @@
#include <sys/socket.h>
#include <boost/system/error_code.hpp>
#include <livoxProto1/device.h>
#include <livoxProto1/livoxProto1.h>
#include "ioUringAssemblyEngine.h"
#include "pcloudStimulusBuffer.h"
#include "livoxGen1.h"
@@ -45,7 +46,7 @@ bool IoUringAssemblyEngine::setup()
if (!frameAssemblyDesc || frameAssemblyDesc->slots.empty())
{ return false; }
// Get UDP socket file descriptor
// Get point cloud data socket descriptor from UdpCommandDemuxer
int udpFd = (*livoxProto1.livoxProto1_getPcloudDataFdDesc)()
->native_handle();
if (udpFd < 0)
@@ -86,7 +87,7 @@ void IoUringAssemblyEngine::resetAndAssembleFrame()
// 1. Submit frameAssemblyDesc->numSlots RECVMSG SQEs using io_uring_prep_recvmsg()
// - Each SQE receives into frameAssemblyDesc->slots[i].vaddr
// - With size frameAssemblyDesc->slots[i].nBytes
// - Socket FD from parent.device->pcloudDataSocketDesc->native_handle()
// - Socket FD from pcloudDataSocketDesc->native_handle()
// 2. Submit batch via io_uring_submit(&ring)
// 3. Set up stall timer using stallTimer with appropriate timeout
// - SQEs are independent and can arrive out of order
@@ -46,6 +46,9 @@ private:
struct io_uring ring;
bool isSetup;
// Point cloud data socket descriptor
std::shared_ptr<boost::asio::posix::stream_descriptor> pcloudDataSocketDesc;
// Stall detection timer
boost::asio::deadline_timer stallTimer;