handle timeouts for socket.read()