Is there a way you can use select() on an single socket, without involving fd_set?
I want to make sure there is something to read before using recv() so it doesn't block. Alternatively use recv() if it immediately can return when there is nothing to read in.
Unfortunately, no.
The only way to use select()
without involving at least one fd_set
is to supply 3 nullptr
s (NULL
s) to select
which effectively turns the select
call into a sleep
using the timeout
argument.