Making a Nonblocking socket for WinSocks and *nix
-
05-07-2019 - |
Question
In C/C++, how would I turn a blocking socket into a non blocking socket in both WinSocks and *nix; so that select() would work correctly. You can use the pre-processor for the platform specific code.
Solution
OTHER TIPS
select() is supposed to work on blocking sockets. It returns when a read() would return immediately, which is always the case with non-blocking sockets.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow