Address

class Address @JvmOverloads constructor(var hostname: String = "127.0.0.1", var port: Int = 2010) : Comparable<Address> , Serializable

This class represents an Address with a hostname and a port. It implements Comparable and Serializable interfaces.

Constructors

Link copied to clipboard
constructor(addr: Address)

Copy constructor that creates a new Address object with the same hostname and port as the given Address.

constructor(hostname: String = "127.0.0.1", port: Int = 2010)

Properties

Link copied to clipboard

The hostname of the address, default is "127.0.0.1".

Link copied to clipboard

The port of the address, default is 2010.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Address): Int

Compares this Address object with the specified Address object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of the Address object.