Datagrams

class Datagrams(val network: InMemoryNetwork, maxDatagramSize: Int = InMemoryNetwork.DEFAULT_MAX_DATAGRAM_SIZE, identity: PeerIdentity = PeerIdentity.None) : InMemoryLink(source)

Datagrams on network, through InMemorySessions on both sides, so that cut has sessions to end: the endpoints see each other as Endpoint.Secure peers whose DTLS layer authenticated identity, by default nobody, and messages go in datagrams of at most maxDatagramSize bytes.

Constructors

Link copied to clipboard
constructor(network: InMemoryNetwork, maxDatagramSize: Int = InMemoryNetwork.DEFAULT_MAX_DATAGRAM_SIZE, identity: PeerIdentity = PeerIdentity.None)

Properties

Link copied to clipboard
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
open suspend override fun server(): InMemoryLink.Side

Attaches the server side; once per link.

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