MCPcopy Create free account
hub / github.com/defold/defold / WaitForMatchingQuestion

Function WaitForMatchingQuestion

engine/dlib/src/test/test_mdns.cpp:972–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970 }
971
972 static bool WaitForMatchingQuestion(dmMDNS::HBrowser browser, dmSocket::Socket socket, const char* qname, uint16_t qtype, RawDnsPacket* packet, uint32_t timeout_ms)
973 {
974 const uint64_t deadline = dmTime::GetMonotonicTime() + (uint64_t) timeout_ms * 1000ULL;
975 while (dmTime::GetMonotonicTime() < deadline)
976 {
977 if (browser)
978 dmMDNS::UpdateBrowser(browser);
979 if (TryReceiveMatchingQuestion(socket, qname, qtype, packet))
980 return true;
981 dmTime::Sleep(5 * 1000);
982 }
983 return false;
984 }
985
986 static bool WaitForMatchingQuestion(dmMDNS::HMDNS mdns, dmSocket::Socket socket, const char* qname, uint16_t qtype, RawDnsPacket* packet, uint32_t timeout_ms)
987 {

Callers 1

TESTFunction · 0.85

Calls 5

UpdateBrowserFunction · 0.85
GetMonotonicTimeFunction · 0.50
SleepFunction · 0.50
UpdateFunction · 0.50

Tested by

no test coverage detected