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 the internal port's clients reach as they join it, http://<address>: a host and a port from 1 to 65535. Not a bare IPv6 literal (::1:9090, whose colons cannot be told from the port's), which of writes as [::1]:9090, nor a host without its port, which a URI reads as port 80, nor port 0 or one past 65535, which nothing listens on.

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.