I have the following code:
FD_SET(mc_sock, &readfds);
foo = FD_ISSET(mc_sock, &readfds); // returns 1
// Wait until some socket on the set is ready to be read
while(select (FD_SETSIZE,&readfds,NULL,NULL,ptv)) {
foo = FD_ISSET(mc_sock, &readfds); // returns 0
I add mc_sock to readfds and FD_ISSET returns 1 as expected. However later when inside while loop FD_ISSET returns 0 without calling FD_CLR. The code jumps into the while when I run a MobileC server but there isn't any FD_CLR in the code runned. I'm quite a newbie in sets and file descriptors and I haven't found out what's happening. Do you have an idea?
Thanks!
ptv? How do you initialize it? - n. 1.8e9-where's-my-share m.selectcan return negative values and you must check for them and examineerrno. - n. 1.8e9-where's-my-share m.