Splits socket address string into host string and port value. Validates port value.
Declared in <util/strencodings.h>
bool
SplitHostPort(
std::string_view in,
uint16_t& portOut,
std::string& hostOut);
true if port-portion is absent or within its allowed range, otherwise false
| Name | Description |
|---|---|
| in [in] | The socket address string to split. |
| portOut [out] | Port-portion of the input, if found and parsable. |
| hostOut [out] | Host-portion of the input, if found. |