Connections

class Connections(val connections: InMemoryConnections, val scheme: CoapScheme = CoapScheme.COAP_TCP, val port: Int = DEFAULT_PORT, clientIdentity: PeerIdentity = PeerIdentity.None) : InMemoryLink(source)

Connections of scheme on connections to a listener at 127.0.0.1:port, whose TLS stand-in reports clientIdentity for every client (see InMemoryConnections.listen).

Constructors

Link copied to clipboard
constructor(connections: InMemoryConnections, scheme: CoapScheme = CoapScheme.COAP_TCP, port: Int = DEFAULT_PORT, clientIdentity: PeerIdentity = PeerIdentity.None)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val port: Int
Link copied to clipboard
open override val scheme: CoapScheme

The URI scheme of the server.

Link copied to clipboard
open override val uri: String

<scheme>://<host>:<port> of the server; known once server attached it.

Functions

Link copied to clipboard
open suspend override fun client(): InMemoryLink.Side

Attaches a client side; as often as the test needs clients.

Link copied to clipboard
open suspend override fun cut()

Ends every way between the sides at once: every session over Datagrams ends, as a DTLS layer reports (RFC 7252 §9.1.1), and every connection breaks (RFC 8323 §3.4). What comes later opens new ones.

Link copied to clipboard

Listens at port for scheme, with clientIdentity.

Link copied to clipboard
open suspend override fun server(): InMemoryLink.Side

Listens at port.

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