Use Select to Monitor Multiple File Descriptors
In the P2P network project, we were asked to simultaneously monitor user input
and also potential in-coming messages, yet we're not supposed to use multiple
threads or processes. That leaves us no choice but the select
function.