Under IPv4, the de facto standard notation 10.1.2.3:1234
is completely clear: it is an IP address with port number. This is understood in URL's for instance: http://10.1.2.3:1234/doc.xhtml
.
If I have a sockaddr_ipv4
class in some code, its tostring
method can return this colon notation and everything is cool.
In a fit of myopia, the designers for the IPv6 addresses numeric notation decided that the colon character was available for their use as a separator. As a result, a colon-delimited port number looks ambiguous on an IPv6 address.
How can we incorporate a port number into a printed representation of an IPv6 address-with-port? Is there some de facto standard way?