question about select sys call
hello people
lets say that i want to use the select sys call as in the example
FD(fd1,&rdf);
FD(fd2,&rdf);
FD(fd3,&rdf);
FD(fd4,&rdf);
while(1){ //let's say that this is the server main loop
select(10, &rdf , NULL , NULL , NULL) ; //waiting select for reading from rdf set
if(FD_ISSET(fd1,&rdf)){ //let's say that fd1 has data for reading
.... //code here
}
?
} //end of loop
after the select returns (so we have something to read from... let's say fd1 as in example)
do i have to re-add the fd's (fd1,fd2,fd3,fd4) in the rdf set before the main loop ends(in the question mark) or there is no problem so i don't add anything in the above piece of code?
thanks
|