Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / sockets wait functions

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. sockets wait functions
#2451
Posted by: 2003-08-10 03:42:03
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?
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sun 2024-10-6  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0