Is it necessary to reset the fd_set between select system call?

Yes (it is necessary to reset the fd_set between select() system calls).

It is a nuisance, but they act as input/output parameters; they are read by and modified by the system call. When select() returns, the values have all been modified to reflect the set of file descriptors ready. So, every time before you call select(), you have to (re)initialize the fd_set values.

Leave a Comment