InMemorySessions
class InMemorySessions(transport: InMemoryTransport, identity: PeerIdentity = PeerIdentity.None) : DatagramTransport(source)
A stand-in for a DTLS layer on an InMemoryTransport, for tests of what a CoAP endpoint does with secure sessions: every peer appears as an Endpoint.Secure, one session per address, authenticated as identity, and nothing is encrypted. endAll ends every session at once, as a DTLS layer reports sessions that closed (DatagramEvent.SessionEnded, RFC 7252 §9.1.1); a send to an ended session throws SessionEndedException, and the next datagram to or from the address opens a new session. Safe to use from any coroutine.
Functions
Link copied to clipboard
Ends every session for reason; the receiver hears of each one as a DatagramEvent.SessionEnded.
Link copied to clipboard
Link copied to clipboard
The session to address, opened if there is none.