- /** 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++)
- {
- if (ev[i])
- {
- if (FD_ISSET (ev[i]->GetFd(), &errfdset))
- {
- ErrorEvents++;
-
- if (getsockopt(ev[i]->GetFd(), SOL_SOCKET, SO_ERROR, (char*)&errcode, &codesize) < 0)
- errcode = errno;
+ socklen_t codesize = sizeof(int);
+ int errcode = 0;
+ if (getsockopt(i, SOL_SOCKET, SO_ERROR, (char*)&errcode, &codesize) < 0)
+ errcode = errno;