Socket Options
| 228 | |
| 229 | // Socket Options |
| 230 | int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen) FL_NOEXCEPT { |
| 231 | SOCKET sock = static_cast<SOCKET>(sockfd); |
| 232 | |
| 233 | // Handle SO_REUSEPORT specially - not supported on Windows |
| 234 | if (level == SOL_SOCKET && optname == SO_REUSEPORT) { |
| 235 | WSASetLastError(WSAENOPROTOOPT); |
| 236 | return -1; |
| 237 | } |
| 238 | |
| 239 | int result = ::setsockopt(sock, level, optname, static_cast<const char*>(optval), optlen); |
| 240 | return (result == SOCKET_ERROR) ? -1 : 0; |
| 241 | } |
| 242 | |
| 243 | int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen) FL_NOEXCEPT { |
| 244 | SOCKET sock = static_cast<SOCKET>(sockfd); |
no outgoing calls
no test coverage detected