- /** An event handler may remove its own descriptor from the list, therefore it is not
- * safe to directly iterate over the list and dispatch events there with STL iterators.
- * Thats a shame because it makes this code slower and more resource intensive, but maybe
- * the user should stop using select(), as select() smells anyway.
- */
- for (int i = 0; i < result; i++)
+ /* Safe assumption (as of 1.1 anyway) that a socket can't remove itself from the list in the middle of the loop */
+ for (std::map<int,int>::iterator a = fds.begin(); a != fds.end(); a++)