Check for closed sockets before attempting a rpc

Ensure that the socket we've selected has been read from within a
second.  If it hasn't, check if it's closed by polling for readability
and if that works, MSG_PEEK'ing a single byte.  If we get eof, or an
error, we can assume it's broken.  This lets us avoid a large class of
transient network failures.
So, if recv returns 0 there was nothing to read, correct?  And we're assuming this means the socket was closed by the other side?  I'm confused because Bernie's trick was to assume that bytes in the read buffer after polling meant a closed socket.  Am I misreading this?