#endif
#include "wx/timer.h"
+#include "wx/private/socketevtdispatch.h"
#include "wx/dfb/private.h"
#define TRACE_EVENTS _T("events")
// NB: we don't block indefinitely waiting for an event, but instead
// time out after a brief period in order to make sure that
// OnNextIteration() will be called frequently enough
- //
- // FIXME: call NotifyTimers() from here (and loop) instead?
const int TIMEOUT = 100;
if ( ms_buffer->WaitForEventWithTimeout(0, TIMEOUT) )
void wxEventLoop::OnNextIteration()
{
#if wxUSE_TIMER
- // see the comment in Dispatch
wxTimer::NotifyTimers();
#endif
+
+#if wxUSE_SOCKETS
+ // handle any pending socket events:
+ wxSocketEventDispatcher::Get().RunLoop();
+#endif
+}
+
+void wxEventLoop::Yield()
+{
+ // process all pending events:
+ while ( Pending() )
+ Dispatch();
+
+ // handle timers, sockets etc.
+ OnNextIteration();
}