HoldableConnection

A Connection whose sends can be held open, over any delegate.

A held send stops before it reaches delegate, so the frame has not been handed over: it is the state a real transport is in while a peer has stopped reading. close unsticks it the way a real transport does: the send throws, and the frame is gone.

Everything else, flush included, is delegate's. A flush answered there says nothing about a send held here, which is correct: Connection.flush covers sends that have returned.

Constructors

Link copied to clipboard
constructor(delegate: Connection)

Properties

Link copied to clipboard
open override val incoming: Flow<ByteArray>
Link copied to clipboard
open override val maxFrameBytes: Int?
Link copied to clipboard
open override val parkedSends: Int

How many sends are stuck at the hold right now. A test asserts this before anything else: a hold nothing reached makes "the flush waited" pass by absence.

Functions

Link copied to clipboard
open suspend override fun close()
Link copied to clipboard
open suspend override fun flush(timeout: Duration): FlushOutcome
Link copied to clipboard
open override fun hold()

From now on, every send stops at the hold until it is released. Sends already past it finish.

Link copied to clipboard
open override fun releaseAll()

Stop holding: everything held goes through, and so does everything after it.

Link copied to clipboard
open override fun releaseOne()

Let the oldest held send through, or the next one to arrive if none is held yet.

Link copied to clipboard
open suspend override fun send(frame: ByteArray)