Advanced Topics for Stream Sockets
Synchronous I/O Multiplexing with Select
exit(1);
}
if (FD_ISSET(s, &read_mask))
do_read(s);
if (FD_ISSET(s, &write_mask))
do_write(s); /* space to write on socket s */
}
}
74
/* something to read on socket s */
/* fall through as maybe more to do */
Chapter 3