I am using the select function for communication between my sockets. I have a while loop and I do -
while(!done) {
FD_ZERO(&read_flags);
FD
When select returns, it has updated the sets to show which file descriptors have become ready for read/write/exception. All other flags have been cleared.
It's important that you re-enable the file descriptors that were cleared prior to starting another select, otherwise, you will no longer be waiting on those file descriptors.
As for re-clearing, it can be a good habit to get into, since if you need to change the set of file descriptors (such as adding a newly opened socket to the read set), you'll want to clear it and rebuilt it every time, so that it's correct as the state of the program changes.