When using select
system call on linux to check if a socket is ready to be read and contains data, is there any difference when setting the timeout value to 0 (not nullptr but real zeros) and setting it to low amount of microseconds?
I am specially interested in the precision of the timeout. Let's say it can wait only 10ms on minimum, no matter what timeout I am giving, this would affect the polling frequency of this implementation a lot.
int socket= 5 ; //just for example, usually somewhere retreived
timeval timevalStruct;
timevalStruct.tv_sec=0;
timevalStruct.tv_usec=0; //Solution A
timevalStruct.tv_usec=1; //Solution B
fd_set in_set;
FD_ZERO(&in_set);
FD_SET(socket, &in_set);
select(socket + 1, &in_set, nullptr, nullptr, &timevalStruct); //how long does it wait here for minimum