- }
- else
- {
- /* NOTE: This is a pair of seperate if statements as the socket
- * may be in both read and writeable state at the same time.
- * If an error event occurs above it is not worth processing the
- * read and write states even if set.
- */
- if (FD_ISSET (ev->GetFd(), &wfdset))
- {
- WriteEvents++;
- writeable[ev->GetFd()] = false;
- ev->HandleEvent(EVENT_WRITE);
- }
- if (FD_ISSET (ev->GetFd(), &rfdset))
- {
- ReadEvents++;
- ev->HandleEvent(EVENT_READ);
- }
- }