iterator through resolver's results

This commit is contained in:
orignal 2024-11-25 19:16:42 -05:00
parent ffd18baf30
commit cc768de8ea
3 changed files with 8 additions and 12 deletions

View file

@ -67,9 +67,9 @@ namespace util
{
bool found = false;
boost::asio::ip::udp::endpoint ep;
for (auto it = endpoints.begin (); it != endpoints.end ();)
for (const auto& it: endpoints)
{
ep = *it;
ep = it;
if (!ep.address ().is_unspecified ())
{
if (ep.address ().is_v4 ())
@ -86,7 +86,6 @@ namespace util
}
}
if (found) break;
it++;
}
if (!found)
{