DWORD WINAPI Server(LPVOID parm)
{
SOCKET s=(SOCKET)parm;
bata(s);//数据处理
return close (s);
}while (1)
{
SOCKET s=accept(.....);
CreateThread(NULL,NULL,Server,s,NULL,NULL);
}
{
SOCKET s=(SOCKET)parm;
bata(s);//数据处理
return close (s);
}while (1)
{
SOCKET s=accept(.....);
CreateThread(NULL,NULL,Server,s,NULL,NULL);
}
那样不是很耗cpu时间吗
CAsyncSocket类
while (1)
{newfd=acept();
Afbeginthread();
}
为什么在accept()处停住了。不执行线程