Guest User

Untitled

a guest
Nov 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. fd_set read_fds;
  2. struct timeval tv;
  3. while(1){
  4. tv.tv_sec = 3;
  5. tv.tv_usec = 0;
  6. FD_ZERO(&read_fds);
  7. FD_SET(0,&read_fds);
  8. FD_SET(pipelogin,&read_fds);
  9. nfd = select(1,&read_fds,NULL,NULL,&tv);
  10. if(nfd==0)
  11. printf("Waiting...");
  12. if(FD_ISSET(0,&read_fds))
  13. comandos();
  14. if(FD_ISSET(pipelogin,&read_fds))
  15. VerificaLogin(pipelogin);
  16. }
Add Comment
Please, Sign In to add comment