projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix undefined variable color to colour
[wxWidgets.git]
/
src
/
common
/
selectdispatcher.cpp
diff --git
a/src/common/selectdispatcher.cpp
b/src/common/selectdispatcher.cpp
index 9321e7c837c61a9ac1bb0294403ee6365c4cf449..ffcf38717912bd16ad42dec7075fbaf77bb1a761 100644
(file)
--- a/
src/common/selectdispatcher.cpp
+++ b/
src/common/selectdispatcher.cpp
@@
-96,14
+96,10
@@
bool wxSelectSets::SetFD(int fd, int flags)
if ( flags & ms_flags[n] )
{
wxFD_SET(fd, &m_fds[n]);
if ( flags & ms_flags[n] )
{
wxFD_SET(fd, &m_fds[n]);
- wxLogTrace(wxSelectDispatcher_Trace,
- _T("Registered fd %d for %s events"), fd, ms_names[n]);
}
else if ( wxFD_ISSET(fd, (fd_set*) &m_fds[n]) )
{
wxFD_CLR(fd, &m_fds[n]);
}
else if ( wxFD_ISSET(fd, (fd_set*) &m_fds[n]) )
{
wxFD_CLR(fd, &m_fds[n]);
- wxLogTrace(wxSelectDispatcher_Trace,
- _T("Unregistered fd %d from %s events"), fd, ms_names[n]);
}
}
}
}
@@
-124,6
+120,9
@@
void wxSelectSets::Handle(int fd, wxFDIOHandler& handler) const
wxLogTrace(wxSelectDispatcher_Trace,
_T("Got %s event on fd %d"), ms_names[n], fd);
(handler.*ms_handlers[n])();
wxLogTrace(wxSelectDispatcher_Trace,
_T("Got %s event on fd %d"), ms_names[n], fd);
(handler.*ms_handlers[n])();
+ // callback can modify sets and destroy handler
+ // this forces that one event can be processed at one time
+ return;
}
}
}
}
}
}
@@
-132,17
+131,6
@@
void wxSelectSets::Handle(int fd, wxFDIOHandler& handler) const
// wxSelectDispatcher
// ----------------------------------------------------------------------------
// wxSelectDispatcher
// ----------------------------------------------------------------------------
-/* static */
-wxSelectDispatcher *wxSelectDispatcher::Create()
-{
- return new wxSelectDispatcher;
-}
-
-wxSelectDispatcher::wxSelectDispatcher()
-{
- m_maxFD = -1;
-}
-
bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags)
{
if ( !wxMappedFDIODispatcher::RegisterFD(fd, handler, flags) )
bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags)
{
if ( !wxMappedFDIODispatcher::RegisterFD(fd, handler, flags) )
@@
-154,6
+142,8
@@
bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags)
if ( fd > m_maxFD )
m_maxFD = fd;
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;
}
return true;
}
@@
-164,6
+154,8
@@
bool wxSelectDispatcher::ModifyFD(int fd, wxFDIOHandler *handler, int flags)
wxASSERT_MSG( fd <= m_maxFD, _T("logic error: registered fd > m_maxFD?") );
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);
}
return m_sets.SetFD(fd, flags);
}
@@
-186,11
+178,15
@@
bool wxSelectDispatcher::UnregisterFD(int fd)
++it )
{
if ( it->first > m_maxFD )
++it )
{
if ( it->first > m_maxFD )
+ {
m_maxFD = it->first;
m_maxFD = it->first;
+ }
}
}
}
}
}
}
+ wxLogTrace(wxSelectDispatcher_Trace,
+ _T("Removed fd %d, current max: %d"), fd, m_maxFD);
return true;
}
return true;
}