| 184 | } |
| 185 | |
| 186 | static bool setSocketBlockingState (SocketHandle handle, bool shouldBlock) noexcept |
| 187 | { |
| 188 | #if JUCE_WINDOWS |
| 189 | u_long nonBlocking = shouldBlock ? 0 : (u_long) 1; |
| 190 | return ioctlsocket (handle, (long) FIONBIO, &nonBlocking) == 0; |
| 191 | #else |
| 192 | int socketFlags = fcntl (handle, F_GETFL, 0); |
| 193 | |
| 194 | if (socketFlags == -1) |
| 195 | return false; |
| 196 | |
| 197 | if (shouldBlock) |
| 198 | socketFlags &= ~O_NONBLOCK; |
| 199 | else |
| 200 | socketFlags |= O_NONBLOCK; |
| 201 | |
| 202 | return fcntl (handle, F_SETFL, socketFlags) == 0; |
| 203 | #endif |
| 204 | } |
| 205 | |
| 206 | #if ! JUCE_WINDOWS |
| 207 | static bool getSocketBlockingState (SocketHandle handle) |
no outgoing calls
no test coverage detected