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

Function WaitForMatchingResponse

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

Source from the content-addressed store, hash-verified

956 }
957
958 static bool WaitForMatchingResponse(dmMDNS::HMDNS mdns, dmSocket::Socket socket, const std::vector<std::string>& names, RawDnsPacket* packet, uint32_t timeout_ms)
959 {
960 const uint64_t deadline = dmTime::GetMonotonicTime() + (uint64_t) timeout_ms * 1000ULL;
961 while (dmTime::GetMonotonicTime() < deadline)
962 {
963 if (mdns)
964 dmMDNS::Update(mdns);
965 if (TryReceiveMatchingResponse(socket, names, packet))
966 return true;
967 dmTime::Sleep(5 * 1000);
968 }
969 return false;
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 {

Callers 3

SendQueryAndCaptureFunction · 0.85
TESTFunction · 0.85

Calls 4

GetMonotonicTimeFunction · 0.50
UpdateFunction · 0.50
SleepFunction · 0.50

Tested by

no test coverage detected