InetSocketAddress

expect constructor(hostname: String, port: Int)(source)


expect constructor(address: ByteArray, port: Int)(source)

Creates an InetSocketAddress from raw IP address bytes and a port number.

Report a problem

Parameters

address

the raw IP address bytes in network byte order: 4 bytes for IPv4 or 16 bytes for IPv6.

port

the port number.

Throws

if address is neither 4 nor 16 bytes long.

actual constructor(hostname: String, port: Int)(source)


actual constructor(address: ByteArray, port: Int)(source)

Creates an InetSocketAddress from raw IP address bytes and a port number.

Report a problem

Parameters

address

the raw IP address bytes in network byte order: 4 bytes for IPv4 or 16 bytes for IPv6.

port

the port number.

Throws

if address is neither 4 nor 16 bytes long.

actual constructor(hostname: String, port: Int)(source)


actual constructor(address: ByteArray, port: Int)(source)

Creates an InetSocketAddress from raw IP address bytes and a port number.

Report a problem

Parameters

address

the raw IP address bytes in network byte order: 4 bytes for IPv4 or 16 bytes for IPv6.

port

the port number.

Throws

if address is neither 4 nor 16 bytes long.