Tcp

class Tcp(host: String, val port: Int, val usesTls: Boolean = false) : Endpoint(source)

The remote side of a TCP or TLS connection (RFC 8323). Messages are scoped to the connection, not to the address, so this only describes the peer; a CoAP endpoint keeps at most one connection per value.

host is an IP literal or, for a connection this side opens, a host name the connector resolves (and TLS checks the certificate against). usesTls tells coaps+tcp from coap+tcp.

Equality is the authority of the URI that names the peer, compared as RFC 7252 §6.6 compares URIs (which RFC 8323 §8.1 and §8.2 adopt): the host case-insensitively, IP literals in their RFC 5952 form (IpLiteral), the port, and the scheme. coap+tcp and coaps+tcp are distinct namespaces even on the same host and port (RFC 8323 §8.2), so endpoints that differ only in usesTls are different peers, with a connection each. A host name and the address it resolves to are different peers too: URIs compare without resolving names.

Constructors

Link copied to clipboard
constructor(host: String, port: Int, usesTls: Boolean = false)

Properties

Link copied to clipboard

The host, in IpLiteral form if it is an IP literal, else as a name in lower case.

Link copied to clipboard
val port: Int
Link copied to clipboard

coap+tcp or coaps+tcp.

Link copied to clipboard

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