example of watching file descriptor