InMemoryConnection

sealed interface InMemoryConnection(source)

One side of an in-memory connection, for fault injection. Closing either side ends both: the other reads what is already on its way, then the end of the stream.

Inheritors

Properties

Link copied to clipboard
abstract val isAccepted: Boolean

Whether this is the side a listener accepted.

Link copied to clipboard
abstract val isClosed: Boolean

Whether either side closed or reset the connection.

Link copied to clipboard
abstract val remote: Endpoint

The other side's address.

Functions

Link copied to clipboard
abstract fun inject(bytes: ByteArray)

Hands bytes to this side as if its peer had written them, for malformed or hand-made messages.

Link copied to clipboard
abstract fun reset()

Breaks the connection at once in both directions; reading then fails with InMemoryConnectionReset.