linux - FD_ISSET returns 0 after FD_SET -


i have following code:

fd_set(mc_sock, &readfds);  foo = fd_isset(mc_sock, &readfds); // returns 1  // wait until socket on set ready read  while(select (fd_setsize,&readfds,null,null,ptv))  {   foo = fd_isset(mc_sock, &readfds); // returns 0 

i add mc_sock readfds , fd_isset returns 1 expected. later when inside while loop fd_isset returns 0 without calling fd_clr. code jumps while when run mobilec server there isn't fd_clr in code runned. i'm quite newbie in sets , file descriptors , haven't found out what's happening. have idea?

thanks!

second, third, , forth arguments of select(2) in-out parameters, meaning call modifies them let know events had happened upon return. why need re-arm file descriptor sets before every call select(2).

also other de-multiplexing facilities poll(2) , epoll(7).


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -