Usage of select() for timeout
问题 I was only able to set maximum of 20 seconds as the timeout parameter in select () API. Whatever value i gave above 20, select() is returning after 20 seconds itself... So i was trying to write a loop for the timeout of 1 minute like this int timeoutcount = 0; do { FD_ZERO(&fd); FD_SET(sock,&fd); timeout.tv_sec = 20; timeout.tv_usec = 0; rc = select (sock+1,&fd,null,null,&timeout); if(rc ==0) timeoutcount += 20; } while(rc ==0 && timeoutcount <60) please help me out...am i going in the