Validate port
-options, so that invalid values are rejected early in the startup.
Ports are uint16_t
s, which effectively limits a port’s value to <=65535. As discussed in #24116 and #24344, port “0” is considered invalid too.
Proposed in #21893 (comment)
The SplitHostPort(std::string in, uint16_t& portOut, std::string& hostOut)
now returns a bool that indicates whether the port value was set and within the allowed range. This is an improvement that can be used not only for port validation of options at startup, but also in rpc calls, etc,