NodeAddress

A node's internal address as its members read it (me.ahoo.wow.spi.subscription.Member.address) and the internal port's clients join it into a URI: host:port, an IPv6 literal in brackets (RFC 3986), [::1]:9090, so that a colon of the host is never read as the port's. The one place an address is built from a host and a port, or its host read back; everywhere else an address is compared as it is.

Functions

Link copied to clipboard
fun hostOf(address: String): String

The host of address, host:port or [ipv6]:port, without the brackets of an IPv6 literal.

Link copied to clipboard
fun isValid(address: String): Boolean

Whether address is one a URI takes as its authority, as the internal port's clients join it: not a bare IPv6 literal (::1:9090, whose colons cannot be told from the port's), which of writes as [::1]:9090.

Link copied to clipboard
fun of(host: String, port: Int): String

host and port as an address: host:port, [ipv6]:port. A host already in brackets stays as it is.