livoxProto1: Open pcloudDataSocket in UdpCmdDemux
The pcloudData socket is now opened by UdpCommandDemuxer, when libLivoxProto1 is initialized. We can now just pick up the socket and be certain it'll be there if the lib is being executed.
This commit is contained in:
@@ -37,7 +37,8 @@ public:
|
||||
UdpCommandDemuxer(
|
||||
const std::shared_ptr<smo::ComponentThread>& componentThread,
|
||||
DeviceManager& deviceManager,
|
||||
uint16_t commandPort = 56001);
|
||||
uint16_t commandPort = 56001,
|
||||
uint16_t dataPort = 56000);
|
||||
|
||||
~UdpCommandDemuxer();
|
||||
|
||||
@@ -53,7 +54,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void setupSocket();
|
||||
void setupSockets();
|
||||
void setupCommandSocket();
|
||||
void setupPcloudDataSocket();
|
||||
void startAsyncReceive();
|
||||
void onDataReady(const boost::system::error_code& error);
|
||||
void processIncomingData();
|
||||
@@ -61,7 +64,10 @@ private:
|
||||
std::shared_ptr<smo::ComponentThread> componentThread;
|
||||
DeviceManager& deviceManager;
|
||||
uint16_t commandPort;
|
||||
uint16_t dataPort;
|
||||
|
||||
// Socket and async objects
|
||||
std::shared_ptr<boost::asio::posix::stream_descriptor> pcloudDataSocketDesc;
|
||||
// Socket and async objects
|
||||
std::shared_ptr<boost::asio::posix::stream_descriptor> cmdEndpointFdDesc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user