diff --git a/DPlusAuthenticator.cpp b/DPlusAuthenticator.cpp index 47b158e..2b51855 100644 --- a/DPlusAuthenticator.cpp +++ b/DPlusAuthenticator.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include #include @@ -54,8 +56,18 @@ bool CDPlusAuthenticator::Process(std::map &gwy_map, c int result = getaddrinfo(m_address.c_str(), NULL, &hints, &infoptr); if (result) { - fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(result)); - return false; + fprintf(stderr, "1st attempt: getaddrinfo: %s\n", gai_strerror(result)); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + result = getaddrinfo(m_address.c_str(), NULL, &hints, &infoptr); + if (result) { + fprintf(stderr, "2nd attempt: getaddrinfo: %s\n", gai_strerror(result)); + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + result = getaddrinfo(m_address.c_str(), NULL, &hints, &infoptr); + if (result) { + fprintf(stderr, "3rd attempt: getaddrinfo: %s\n", gai_strerror(result)); + return false; + } + } } struct addrinfo *p;