int i;
struct GsocketCallbackInfo
*CallbackInfo = (struct GsocketCallbackInfo *)m_sockCallbackInfo;
- int r = 0;
timeout.tv_sec = 0;
timeout.tv_usec = 0;
if ( select(m_maxSocketNr, &readfds, &writefds, 0, &timeout) > 0)
{
- for (i = m_lastUsedHandle + 1; i != m_lastUsedHandle; i++)
+ for (i = m_lastUsedHandle + 1; i != m_lastUsedHandle;
+ (i < m_maxSocketNr - 1) ? i++ : (i = 0))
{
- if (i == m_maxSocketNr)
- i = 0;
if (FD_ISSET(i, &readfds))
{
int r;
{
CallbackInfo[r].proc(CallbackInfo[r].gsock);
pendingEvent = TRUE;
- wxYield();
}
}
if (FD_ISSET(i, &writefds))
{
CallbackInfo[r].proc(CallbackInfo[r].gsock);
pendingEvent = TRUE;
- wxYield();
}
}
}
m_lastUsedHandle = i;
}
if (pendingEvent)
- wxYield();
+ ProcessPendingEvents();
}
}
// ---------------------------------------------------------------------------
argc = 0;
argv = NULL;
m_nPrintMode = wxPRINT_WINDOWS;
- m_bAuto3D = TRUE;
m_hMq = 0;
m_maxSocketHandles = 0;
m_maxSocketNr = 0;
while (!Pending() && ProcessIdle())
{
HandleSockets();
- wxUsleep(10000);
+ wxUsleep(10);
}
HandleSockets();
if (Pending())
DoMessage();
else
- wxUsleep(10000);
+ wxUsleep(10);
}
return (int)svCurrentMsg.mp1;
return;
gbInOnIdle = TRUE;
-
- //
- // If there are pending events, we must process them: pending events
- // are either events to the threads other than main or events posted
- // with wxPostEvent() functions
- //
- ProcessPendingEvents();
-
- //
- // 'Garbage' collection of windows deleted with Close().
- //
- DeletePendingObjects();
-
-#if wxUSE_LOG
- //
- // Flush the logged messages if any
- //
- wxLog::FlushActive();
-#endif // wxUSE_LOG
+
+ wxAppBase::OnIdle(event);
#if wxUSE_DC_CACHEING
// automated DC cache management: clear the cached DCs and bitmap
wxDC::ClearCache();
#endif // wxUSE_DC_CACHEING
- //
- // Send OnIdle events to all windows
- //
- if (SendIdleEvents())
- {
- //
- // SendIdleEvents() returns TRUE if at least one window requested more
- // idle events
- //
- rEvent.RequestMore(TRUE);
- }
gbInOnIdle = FALSE;
} // end of wxApp::OnIdle
if (wxTheApp)
wxTheApp->ProcessPendingEvents();
+ HandleSockets();
//
// Let the logs be flashed again
//