toIPSocketAddress

@JvmStatic
@JvmName(name = "get")
fun String.toIPSocketAddress(): IPSocketAddress(source)

Parses a String for its IPv4 or IPv6 address and port.

String can be either a URL containing the IP address and port, or the IP address and port itself.

Return

IPSocketAddress

Throws

IllegalArgumentException

If not a valid IP address and port.