ddn.net.dtls.transport
DTLS transport abstraction layer.
Provides concrete implementations of the datagram transport and timer interfaces defined in ddn.api.net.dtls. Includes in-memory transport and manual timer for unit testing.
Types 2
classMemoryDtlsTransport : DtlsTransport
In-memory DTLS transport for unit testing.
Datagrams written via sendTo() are buffered and can be retrieved via recvFrom() on a connected peer transport. Useful for testing DTLS logic without real network I/O.
Methods
void connect(MemoryDtlsTransport a, MemoryDtlsTransport b)Connect two MemoryDtlsTransport instances for bidirectional communication.ptrdiff_t recvFrom(ubyte[] buffer, out DatagramEndpoint sender)Receive a single datagram.ptrdiff_t sendTo(const(ubyte)[] data, DatagramEndpoint dest)Send a single datagram to the given address.PollHandle pollHandle() @property constReturns an invalid PollHandle (memory transport has no OS handle).void close()Close the transport.void injectDatagram(const(ubyte)[] data, DatagramEndpoint sender)Inject a datagram directly into the inbox for testing.Constructors
this(DatagramEndpoint localAddr = DatagramEndpoint.init)Constructs a MemoryDtlsTransport with an optional local address.classManualTimerSink : DtlsTimerSink
Manual timer sink for unit testing.
Allows explicit triggering of scheduled timeouts for deterministic testing of DTLS retransmission logic.
Methods
void scheduleTimeout(Duration delay, void delegate() onTimeout)Schedule a timeout callback.void cancelTimeout()Cancel any previously scheduled timeout.bool trigger()Manually trigger the scheduled timeout.