support boost 1.87

This commit is contained in:
orignal 2024-11-25 16:00:06 -05:00
parent 3474538697
commit ffd18baf30
28 changed files with 164 additions and 172 deletions

View file

@ -62,14 +62,12 @@ namespace util
LogPrint (eLogInfo, "Timestamp: NTP request to ", address);
boost::asio::io_context service;
boost::system::error_code ec;
auto it = boost::asio::ip::udp::resolver (service).resolve (
boost::asio::ip::udp::resolver::query (address, "ntp"), ec);
auto endpoints = boost::asio::ip::udp::resolver (service).resolve (address, "ntp", ec);
if (!ec)
{
bool found = false;
boost::asio::ip::udp::resolver::iterator end;
boost::asio::ip::udp::endpoint ep;
while (it != end)
for (auto it = endpoints.begin (); it != endpoints.end ();)
{
ep = *it;
if (!ep.address ().is_unspecified ())
@ -154,7 +152,7 @@ namespace util
{
m_IsRunning = true;
LogPrint(eLogInfo, "Timestamp: NTP time sync starting");
m_Service.post (std::bind (&NTPTimeSync::Sync, this));
boost::asio::post (m_Service, std::bind (&NTPTimeSync::Sync, this));
m_Thread.reset (new std::thread (std::bind (&NTPTimeSync::Run, this)));
}
else