livoxProto1:bug workaround: for boost:asio:udp async ops on dlopen libs
Updated Boost dependency to version 1.73.0 to address segfault issues with boost::asio in dynamic libraries. Refactored heartbeat socket management to use raw UDP sockets instead of boost::asio, improving compatibility and error handling during socket operations.
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
#include <memory>
|
||||
#include <atomic>
|
||||
#include <optional>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <boost/asio.hpp>
|
||||
#include "protocol.h"
|
||||
|
||||
@@ -94,7 +98,7 @@ private:
|
||||
|
||||
// Heartbeat state
|
||||
std::unique_ptr<boost::asio::deadline_timer> heartbeatTimer;
|
||||
std::unique_ptr<boost::asio::ip::udp::socket> heartbeatSocket;
|
||||
int heartbeatSocketFd; // Raw socket file descriptor
|
||||
std::atomic<bool> heartbeatActive;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user