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

Function WaitForEvent

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

Source from the content-addressed store, hash-verified

246 }
247
248 static bool WaitForEvent(EventLog& event_log, dmMDNS::EventType event_type, const char* instance_name, dmMDNS::HMDNS mdns, dmMDNS::HBrowser browser, uint32_t timeout_ms)
249 {
250 const uint64_t deadline = dmTime::GetMonotonicTime() + (uint64_t) timeout_ms * 1000ULL;
251 while (dmTime::GetMonotonicTime() < deadline)
252 {
253 if (event_log.HasInstance(event_type, instance_name))
254 {
255 return true;
256 }
257 Pump(mdns, browser, 1, 5 * 1000);
258 }
259 return event_log.HasInstance(event_type, instance_name);
260 }
261
262 static bool WaitForEventCount(EventLog& event_log, dmMDNS::EventType event_type, const char* instance_name, uint32_t count, dmMDNS::HMDNS mdns, dmMDNS::HBrowser browser, uint32_t timeout_ms)
263 {

Callers 1

TESTFunction · 0.85

Calls 3

PumpFunction · 0.85
HasInstanceMethod · 0.80
GetMonotonicTimeFunction · 0.50

Tested by

no test coverage detected