Follow-up to #36340, addressing the review comments from pinheadmz and winterrdog there.
#36340 capped the Sock::Wait/WaitMany timeout at INT_MAX milliseconds (about 24.8 days) inside WaitMany. This moves that value to a named constant, Sock::MAX_WAIT_TIMEOUT, and mentions the cap in the doxygen comments of Wait() and WaitMany(), since it applies to every caller and not only to bitcoin-cli. The constant is a whole number of seconds (2147483 s), so bitcoin-cli, which works in seconds, uses exactly the same value as Sock.
bitcoin-cli still turned -rpcclienttimeout=0 into a 5 year timeout. The timeout is applied to each wait for the socket, and each wait is now capped, so in practice 0 already means "give up after about 24.8 days without data". The 5 year value is replaced with Sock::MAX_WAIT_TIMEOUT, and the help text now says that 0 is the longest supported timeout (about 24 days) instead of no timeout.
There is no behaviour change. sock_tests, interface_bitcoin_cli.py (including the -rpcclienttimeout=0 call added in #36340) and interface_rpc.py pass on macOS.
(Changes prepared with AI tools.)