1. When reading from a socket, how does socket timeout work?
Will an fgets wait for timeout length per attempt, or timeout is the
time allowed for repeated fgets attempts, such as in a loop?
2. Does timeout have an effect if a socket is set to nonblocking, or
does it apply to blocking sockets only?