From a5cf996ed245dd3abe97375d9d35c522c70e3ff1 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Fri, 24 Oct 2025 01:44:19 -0400 Subject: [PATCH] LivoxProto1: Get rid of raw FD for pcloudData recv --- commonLibs/livoxProto1/device.cpp | 12 +----------- commonLibs/livoxProto1/device.h | 1 - 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/commonLibs/livoxProto1/device.cpp b/commonLibs/livoxProto1/device.cpp index d7d1bed..3a655ab 100644 --- a/commonLibs/livoxProto1/device.cpp +++ b/commonLibs/livoxProto1/device.cpp @@ -101,8 +101,7 @@ handshakeTimeoutMs(handshakeTimeoutMs), retryDelayMs(retryDelayMs), smoIp(smoIp), detectedSmoListeningIp(""), smoSubnetNbits(smoSubnetNbits), dataPort(dataPort), cmdPort(cmdPort), imuPort(imuPort), heartbeatActive(false), -pcloudDataActive(false), -pcloudDataFd(-1) +pcloudDataActive(false) { } @@ -119,10 +118,6 @@ Device::~Device() heartbeatTimer.reset(); pcloudDataSocketDesc.reset(); - if (pcloudDataFd >= 0) { - close(pcloudDataFd); - pcloudDataFd = -1; - } } /** @@ -1809,7 +1804,6 @@ bool Device::setupPcloudDataSocket() std::make_unique( componentThread->getIoService(), socketGuard.getFd()); - pcloudDataFd = socketGuard.getFd(); socketGuard.release(); return true; } @@ -1820,10 +1814,6 @@ void Device::cleanupPcloudDataSocket() pcloudDataSocketDesc->cancel(); pcloudDataSocketDesc.reset(); } - if (pcloudDataFd >= 0) { - close(pcloudDataFd); - pcloudDataFd = -1; - } pcloudDataActive.store(false); } diff --git a/commonLibs/livoxProto1/device.h b/commonLibs/livoxProto1/device.h index 292b5d5..923825b 100644 --- a/commonLibs/livoxProto1/device.h +++ b/commonLibs/livoxProto1/device.h @@ -160,7 +160,6 @@ public: // Point cloud data state std::unique_ptr pcloudDataSocketDesc; std::atomic pcloudDataActive; - int pcloudDataFd; // Socket file descriptor for point cloud data reception public: // UDP datagram handling