Udp

class Udp(host: String, val port: Int) : Endpoint(source)

A UDP peer or group: an IP address and a port.

host is an IP literal; names are resolved before a transport sees them. It is kept in IpLiteral form whatever text was given, so one address has one host and one endpoint: FE80::0:1, fe80::1 and [fe80::1] name the same peer, and so do ::ffff:192.0.2.1 and 192.0.2.1, as a dual-stack socket reports them.

Equality is the matching rule of RFC 7252 §5.3.2 (a response comes from the endpoint the request went to) and the scope of Message IDs (§4.4, §4.5): the same address and the same port. The address compares as RFC 7252 §6.6 compares URI hosts, case-insensitively and with IP literals in their RFC 5952 form. Text that is not an IP literal, which only a test or a link without IP should use, compares case-insensitively (RFC 3986 §3.2.2).

Constructors

Link copied to clipboard
constructor(host: String, port: Int)

Properties

Link copied to clipboard

The address, in IpLiteral form (or in lower case, for text that is not an IP literal).

Link copied to clipboard
val port: Int

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String