InMemoryTransport

A DatagramTransport attached to an InMemoryNetwork at localEndpoint. Obtain one from InMemoryNetwork.attach.

send copies the datagram, so neither side can change what the other sees. After close, send throws and receive throws ClosedReceiveChannelException once queued events are drained.

Properties

Link copied to clipboard

True once close was called.

Link copied to clipboard
Link copied to clipboard
open override val maxDatagramSize: Int

Functions

Link copied to clipboard
open suspend override fun close()
Link copied to clipboard
fun inject(event: DatagramEvent)

Hands event to the receiver of this transport as if it had come from the network, or from a DTLS layer (for DatagramEvent.SessionEnded). Tests use it to simulate what the network cannot.

Link copied to clipboard
open suspend override fun receive(): DatagramEvent
Link copied to clipboard
open suspend override fun send(to: Endpoint, datagram: ByteArray)
Link copied to clipboard
open override fun toString(): String