ddn.net.tls.transport
Memory-based TLS transport for testing.
Provides an in-memory implementation of TlsTransport using byte buffers. Useful for unit testing TLS logic without real network I/O.
Types 2
classMemoryTransport : TlsTransport
In-memory transport using byte buffers.
Reads consume from inputBuffer, writes append to outputBuffer. This allows two MemoryTransport instances to be wired together for bidirectional testing.
Fields
bool open_ubyte[] input_ubyte[] output_Methods
ptrdiff_t read(ubyte[] buffer)Reads bytes from the internal input buffer into `buffer`.ptrdiff_t write(const(ubyte)[] data)Writes bytes to the internal output buffer.void flush()No-op flush for memory transport.void close()Closes the transport. Further reads/writes return `IoResult.CLOSED`.const(ubyte)[] outputBuffer() @property constReturns: The accumulated output bytes (what has been written).void feed(const(ubyte)[] data)Appends data to the input buffer for future reads.void clearOutput()Clears the output buffer.PollHandle pollHandle() @property constReturns: An invalid PollHandle (memory transport has no OS handle).Constructors
this(const(ubyte)[] initialInput = null)Constructs a MemoryTransport with optional initial input data.classPipeEnd : TlsTransport
Bidirectional pipe transport for integration testing.
Create a pair with PipeEnd.createPair(). Data written to one end becomes available for reading on the peer. Reads block until data is available or the transport is closed.
Methods
PipeEnd[2] createPair()Creates a connected pair of pipe transports.ptrdiff_t read(ubyte[] buf)ptrdiff_t write(const(ubyte)[] data)void flush()void close()PollHandle pollHandle() @property constReturns: An invalid PollHandle (pipe transport has no OS handle).Constructors
this()Constructs a single pipe end (use `createPair()` instead).