Added a 5 second timeout to reading the socket. If nothing arrives within 5 seconds of the read starting, an error is thrown and the connection dies.