Usually in something like this when there is no timeout, you should use a value like zero (indicating no timeout) and check for that special case. I would not use MAX_VALUE at all.