- if (wxFD_ISSET(i, writeset))
- {
- wxLogTrace(wxSelectDispatcher_Trace,wxT("Got write event on fd %d"),i);
- if (handler == NULL)
- handler = FindHandler(i);
- if (handler != NULL && wxFD_ISSET(i,&m_writeset))
- handler->OnWriteWaiting(i);
- else
- {
- wxLogError(wxT("Lost fd in write fdset: %d, removing"),i);
- wxFD_CLR(i,&m_writeset);
- };
- };
+ if ( !m_sets.SetFD(fd, flags) )
+ return false;
+
+ if ( fd > m_maxFD )
+ m_maxFD = fd;
+
+ wxLogTrace(wxSelectDispatcher_Trace,
+ _T("Registered fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT), (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION);
+ return true;
+}
+
+bool wxSelectDispatcher::ModifyFD(int fd, wxFDIOHandler *handler, int flags)
+{
+ if ( !wxMappedFDIODispatcher::ModifyFD(fd, handler, flags) )
+ return false;
+
+ wxASSERT_MSG( fd <= m_maxFD, _T("logic error: registered fd > m_maxFD?") );
+
+ wxLogTrace(wxSelectDispatcher_Trace,
+ _T("Modified fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT) == wxFDIO_OUTPUT, (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION);
+ return m_sets.SetFD(fd, flags);
+}
+
+bool wxSelectDispatcher::UnregisterFD(int fd)
+{
+ m_sets.ClearFD(fd);