MCPcopy Create free account
hub / github.com/Kitware/CMake / setBlocking

Function setBlocking

Utilities/cmcppdap/src/socket.cpp:63–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63bool setBlocking(SOCKET s, bool blocking) {
64#if defined(_WIN32)
65 u_long mode = blocking ? 0 : 1;
66 return ioctlsocket(s, FIONBIO, &mode) == NO_ERROR;
67#else
68 auto arg = fcntl(s, F_GETFL, nullptr);
69 if (arg < 0) {
70 return false;
71 }
72 arg = blocking ? (arg & ~O_NONBLOCK) : (arg | O_NONBLOCK);
73 return fcntl(s, F_SETFL, arg) >= 0;
74#endif
75}
76
77bool errored(SOCKET s) {
78 if (s == InvalidSocket) {

Callers 1

connectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…