• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Anyone ever use the select() function?

engineereeyore

Platinum Member
Ok, I understand how to add file descriptors and the whole idea of what select does. I understand that it returns the number of descriptors that are ready to be read, write, or handled. What I don't understand is how I'm supposed to know WHICH desciptor is ready. Does it reorganize the fd_set array so that all the ones that are ready are at the front of the array, or do I have to go through all of them and check them somehow?

Any help would be greatly appreciated.
 
I believe you use the FD_ISSET macro to determine if a certain descriptor is in the 'ready' category. If you have a Linux box handy there's a select_tut(2) man page in the manpages-dev (on Debian at least) package which might answer your question.
 
You would appear to be correct. I was hoping it was more specific, but I guess that's still much better than performing a read on several different socket descriptors.

Thanks for the info. That man page is very nice.
 
Back
Top