MCPcopy Create free account
hub / github.com/HumbleNet/HumbleNet / setSocketBlockingState

Function setSocketBlockingState

3rdparty/Amalgamate/juce_core_amalgam.cpp:7160–7178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7158 }
7159
7160 static bool setSocketBlockingState (const int handle, const bool shouldBlock) noexcept
7161 {
7162 #if JUCE_WINDOWS
7163 u_long nonBlocking = shouldBlock ? 0 : (u_long) 1;
7164 return ioctlsocket (handle, FIONBIO, &nonBlocking) == 0;
7165 #else
7166 int socketFlags = fcntl (handle, F_GETFL, 0);
7167
7168 if (socketFlags == -1)
7169 return false;
7170
7171 if (shouldBlock)
7172 socketFlags &= ~O_NONBLOCK;
7173 else
7174 socketFlags |= O_NONBLOCK;
7175
7176 return fcntl (handle, F_SETFL, socketFlags) == 0;
7177 #endif
7178 }
7179
7180 static bool connectSocket (int volatile& handle,
7181 const bool isDatagram,

Callers 1

connectSocketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected