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

Function Select

engine/dlib/src/dlib/socket.cpp:265–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263 }
264
265 Result Select(Selector* selector, int32_t timeout)
266 {
267 if (timeout > 0)
268 {
269 timeout = timeout / 1000;
270 }
271 int r = dmFileDescriptor::Wait(&selector->m_Poller, (timeout < 0) ? 0 : timeout);
272 if (r < 0)
273 {
274 return NativeToResult(__FUNCTION__, __LINE__, DM_SOCKET_ERRNO);
275 }
276 else if(timeout > 0 && r == 0)
277 {
278 return RESULT_WOULDBLOCK;
279 }
280 else
281 {
282 return RESULT_OK;
283 }
284 }
285}

Callers 15

dmLogUpdateNetworkFunction · 0.70
ConnectSocketFunction · 0.70
UpdateFunction · 0.70
HandleIncomingQueriesFunction · 0.70
HandleBrowserResponsesFunction · 0.70
SpawnParticleFunction · 0.50
NonZeroVector3Function · 0.50
ApplyRadialFunction · 0.50
ApplyVortexFunction · 0.50
SimulateFunction · 0.50

Calls 2

WaitFunction · 0.70
NativeToResultFunction · 0.70

Tested by 2

TESTFunction · 0.40
WaitForRawSocketReadableFunction · 0.40