若将超时值设置为( 0 , 0),表明s e l e c t会立即返回,允许应用程序对s e l e c t操作进行“轮询”。出于对性能方面的考虑,应避免这样的设置。。s e l e c t成功完成后,会在f d _ s e t结构中,返回刚好有未完成的I / O操作的所有套接字句柄的总量。若超过t i m e v a l设定的时间,便会返回0。不管由于什么原因,假如s e l e c t调用失败,都会返回S O C K E T _ E R R O R。
判断select返回值了吗?
int mComm::Run()
{
// TODO: Add your specialized code here and/or call the base class
while (Loop)
{
JudgeBlocking();
MainProc();
Sleep(1);
}
return CWinThread::Run();
}