MCPcopy Create free account
hub / github.com/FastLED/FastLED / set_nonblocking

Function set_nonblocking

src/fl/stl/asio/http/server.cpp.hpp:139–148  ·  view source on GitHub ↗

Helper: Set socket to non-blocking mode

Source from the content-addressed store, hash-verified

137
138// Helper: Set socket to non-blocking mode
139bool set_nonblocking(int fd) {
140#ifdef FL_IS_WIN
141 u_long mode = 1;
142 return ioctlsocket(fd, FIONBIO, &mode) == 0;
143#else
144 int flags = fcntl(fd, F_GETFL, 0);
145 if (flags == -1) return false;
146 return fcntl(fd, F_SETFL, flags | O_NONBLOCK) != -1;
147#endif
148}
149
150} // anonymous namespace
151

Callers 2

setup_listen_socketMethod · 0.70
accept_connectionsMethod · 0.70

Calls 1

fcntlFunction · 0.50

Tested by

no test coverage detected