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

Function NativeToResultCompat

engine/dlib/src/dlib/socket_win32.cpp:186–194  ·  view source on GitHub ↗

Use this function for BSD socket compatibility However, don't use it blindly as we return code ETIMEDOUT is "lost". The background is that ETIMEDOUT is returned rather than EWOULDBLOCK on windows on socket timeout.

Source from the content-addressed store, hash-verified

184 // The background is that ETIMEDOUT is returned rather than EWOULDBLOCK on windows
185 // on socket timeout.
186 static Result NativeToResultCompat(int r)
187 {
188 Result res = NativeToResult(__FILE__, __LINE__, r);
189 if (res == RESULT_TIMEDOUT)
190 {
191 res = RESULT_WOULDBLOCK;
192 }
193 return res;
194 }
195
196 bool IsSocketIPv4(Socket socket)
197 {

Callers 3

SendFunction · 0.70
socket_win32.cppFile · 0.70
ReceiveFunction · 0.70

Calls 1

NativeToResultFunction · 0.70

Tested by

no test coverage detected