I tested this code (it's in overrided wxThread::Entry())
wxSocketServer* m_pSocketServer;
while(!TestDestroy())
{
if(m_pSocketServer->WaitForAccept(0, 500))
AddClient(pSock);
}
and WaitForAccept() returns false when client connected. But next code works:
while(!TestDestroy())
{
pSock = m_pSocketServer->Accept(FALSE);
if(pSock)
AddClient(pSock);
Sleep(500);
}
Whats wrong? |