- // unregister descriptor from sets and return handler for cleanup
- wxFDIOHandler* UnregisterFD(int fd, int flags = wxSelectAll);
+ // call select() with our sets: the other parameters are the same as for
+ // select() itself
+ int Select(int nfds, struct timeval *tv);
+
+ // call the handler methods corresponding to the sets having this fd
+ void Handle(int fd, wxFDIOHandler& handler) const;
+
+private:
+ typedef void (wxFDIOHandler::*Callback)();
+
+ // the FD sets indices
+ enum
+ {
+ Read,
+ Write,
+ Except,
+ Max
+ };
+
+ // the sets used with select()
+ fd_set m_fds[Max];
+
+ // the wxFDIO_XXX flags, functions and names (used for debug messages only)
+ // corresponding to the FD sets above
+ static int ms_flags[Max];
+ static const char *ms_names[Max];
+ static Callback ms_handlers[Max];
+};