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

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

  
Forum List • Thread List • Reply • 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 • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥477.00 ·
 
 
¥918.00 ·
 
 
¥370.00 ·
 
 
¥271.00 ·
 
 
¥995.00 ·
 
 
¥1,580.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0