Got sockets working.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@22680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -171,15 +171,13 @@ void wxApp::HandleSockets()
|
|||||||
int i;
|
int i;
|
||||||
struct GsocketCallbackInfo
|
struct GsocketCallbackInfo
|
||||||
*CallbackInfo = (struct GsocketCallbackInfo *)m_sockCallbackInfo;
|
*CallbackInfo = (struct GsocketCallbackInfo *)m_sockCallbackInfo;
|
||||||
int r = 0;
|
|
||||||
timeout.tv_sec = 0;
|
timeout.tv_sec = 0;
|
||||||
timeout.tv_usec = 0;
|
timeout.tv_usec = 0;
|
||||||
if ( select(m_maxSocketNr, &readfds, &writefds, 0, &timeout) > 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))
|
if (FD_ISSET(i, &readfds))
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
@@ -192,7 +190,6 @@ void wxApp::HandleSockets()
|
|||||||
{
|
{
|
||||||
CallbackInfo[r].proc(CallbackInfo[r].gsock);
|
CallbackInfo[r].proc(CallbackInfo[r].gsock);
|
||||||
pendingEvent = TRUE;
|
pendingEvent = TRUE;
|
||||||
wxYield();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (FD_ISSET(i, &writefds))
|
if (FD_ISSET(i, &writefds))
|
||||||
@@ -206,14 +203,13 @@ void wxApp::HandleSockets()
|
|||||||
{
|
{
|
||||||
CallbackInfo[r].proc(CallbackInfo[r].gsock);
|
CallbackInfo[r].proc(CallbackInfo[r].gsock);
|
||||||
pendingEvent = TRUE;
|
pendingEvent = TRUE;
|
||||||
wxYield();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_lastUsedHandle = i;
|
m_lastUsedHandle = i;
|
||||||
}
|
}
|
||||||
if (pendingEvent)
|
if (pendingEvent)
|
||||||
wxYield();
|
ProcessPendingEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -827,7 +823,6 @@ void wxApp::DoMessage(
|
|||||||
int wxApp::MainLoop()
|
int wxApp::MainLoop()
|
||||||
{
|
{
|
||||||
m_bKeepGoing = TRUE;
|
m_bKeepGoing = TRUE;
|
||||||
|
|
||||||
while (m_bKeepGoing)
|
while (m_bKeepGoing)
|
||||||
{
|
{
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
@@ -1165,6 +1160,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
|
|||||||
if (wxTheApp)
|
if (wxTheApp)
|
||||||
wxTheApp->ProcessPendingEvents();
|
wxTheApp->ProcessPendingEvents();
|
||||||
|
|
||||||
|
HandleSockets();
|
||||||
//
|
//
|
||||||
// Let the logs be flashed again
|
// Let the logs be flashed again
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user