IpLiteral
The one textual form of an IP address, which Endpoint.Udp and Endpoint.Tcp keep their host in, so that one address is one endpoint: dotted decimal for IPv4, RFC 5952 canonical text for IPv6 (lower case, no leading zeros, the longest run of two or more zero groups compressed to ::). IPv4-mapped IPv6 addresses are written as IPv4, as a dual-stack socket reports such peers.
Transports format received addresses with format; endpoints and clients normalize literals with canonical.
Functions
The bytes of an IPv4 or IPv6 literal, or null if text is none. The grammar is RFC 3986 §3.2.2's IPv4address and IPv6address: a decimal octet has no leading zero and a group is one to four hex digits, without a sign. Other text is a name, not an address: 010.0.0.1 is no literal, since RFC 3986 §7.4 warns that resolvers may read it as octal, an address other than 10.0.0.1.