FD_ZERO(&rfds); FD_ZERO(&wfds); if (rd) //TRUE FD_SET(*s,&rfds); //添加要测试的描述字 if (wr) //FALSE FD_SET(*s,&wfds); tv.tv_sec=timems/1000; //second tv.tv_usec=timems%1000; //ms for (;;) //如果errno==EINTR,反复测试缓冲区的可读性 switch(select((*s)+1,&r...
#endif FD_ZERO(&rfds); FD_ZERO(&wfds); if (rd)//TRUE FD_SET(*s,&rfds);//添加要测试的描述字 if (wr)//FALSE FD_SET(*s,&wfds); tv.tv_sec=timems/1000;//second tv.tv_usec=timems00;//ms for (;;) //如果errno==EINTR,反复测试缓冲区的可读性 switch(select((*s)+1,&rfds...
FD_ZERO(&rfds); FD_ZERO(&wfds); if (rd) //TRUE FD_SET(*s,&rfds); //添加要测试的描述字 if (wr) //FALSE FD_SET(*s,&wfds); tv.tv_sec=timems/1000; //second tv.tv_usec=timems%1000; //ms for (;;) //如果errno==EINTR,反复测试缓冲区的可读性 switch(select((*s)+1,&r...
将标准输入(fd=0)加到文件表述符集合rfds中。
fd_set rfds,wfds; #ifdef _WIN32 TIM tv; #else struct tim tv; #endif FD_ZERO(&rfds); FD_ZERO(&wfds); if (rd) //TRUE FD_SET(*s,&rfds); //添加要测试的描述字 if (wr) //FALSE FD_SET(*s,&wfds); tv.tv_sec=timems/1000; //second ...
fd_set rfds, wfds; #ifdef _WIN32 TIMEVAL tv; #else struct timeval tv; #endif /*_WIN32*/ FD_ZERO(&rfds); FD_ZERO(&wfds); if(rd) //TRUE FD_SET(*s, &rfds); //添加要测试的描述字 if(wr) FD_SET(*s, &wfds); tv.tv_sec = timems/1000; //seconds ...
fd_set rfds,wfds; #ifdef _WIN32 TIM tv; #else struct tim tv; #endif FD_ZERO(&rfds); FD_ZERO(&wfds); if (rd) //TRUE FD_SET(*s,&rfds); //添加要测试的描述字 if (wr) //FALSE FD_SET(*s,&wfds); tv.tv_sec=timems/1000; //second ...
fd_set rfds,wfds; #ifdef _WIN32 TIM tv; #else struct tim tv; #endif FD_ZERO(&rfds); FD_ZERO(&wfds); if (rd) //TRUE FD_SET(*s,&rfds); //添加要测试的描述字 if (wr) //FALSE FD_SET(*s,&wfds); tv.tv_sec=timems/1000; //second ...
fd_set rfds,wfds; #ifdef _WIN32 TIM tv; #else struct tim tv; #endif FD_ZERO(&rfds); FD_ZERO(&wfds); if (rd)//TRUE FD_SET(*s,&rfds);//添加要测试的描述字 if (wr)//FALSE FD_SET(*s,&wfds); tv.tv_sec=timems/1000;//second ...
fd_set rfds, wfds; #ifdef _WIN32 TIMEVAL tv; #else struct timeval tv; #endif /*_WIN32*/ FD_ZERO(&rfds); FD_ZERO(&wfds); if(rd) //TRUE FD_SET(*s, &rfds); //添加要测试的描述字 if(wr) FD_SET(*s, &wfds); tv.tv_sec = timems/1000; //seconds ...