corda / net.corda.core.utilities / NetworkHostAndPort

NetworkHostAndPort

data class NetworkHostAndPort

Tuple of host and port. Use NetworkHostAndPort.parse on untrusted data.

Parameters

host - a hostname or IP address. IPv6 addresses must not be enclosed in square brackets.

port - a valid port number.

Constructors

<init>

NetworkHostAndPort(host: String, port: Int)

Tuple of host and port. Use NetworkHostAndPort.parse on untrusted data.

Properties

host

val host: String

a hostname or IP address. IPv6 addresses must not be enclosed in square brackets.

port

val port: Int

a valid port number.

Functions

toString

fun toString(): String

Companion Object Functions

parse

fun parse(str: String): NetworkHostAndPort

Parses a string of the form host:port into a NetworkHostAndPort. The host part may be a hostname or IP address. If it's an IPv6 address, it must be enclosed in square brackets. Note this does not parse the toString of a resolved java.net.InetSocketAddress, which is of a host/IP:port form.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.