Rescue EOFError when reading on socket.