mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
support boost 1.87
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user