Add error checks and remove the now unnecessary timeout check

- explicitly check for a read failure and null socket
- remove the timeout check we added since we shouldn't need it anymore and it makes the code uglier