class AsyncHttp2Stream
source · line 12public class AsyncHttp2Stream internal constructor(internal val state: H2State, internal val stream: H2Stream) : AsyncByteStream, AsyncCloseable
- Supertype
AsyncByteStream - Supertype
AsyncCloseable
One multiplexed HTTP/2 exchange. Serialize operations within each direction; different streams can progress independently. Reading returns flow-control credit as data is consumed.
function receiveResponse
source · line 44public suspend fun receiveResponse(): HttpResponseHead
Receives the next response head for this client stream.
function close
source · line 87public override suspend fun close(): Unit
- Overrides
close
Resets or cleans up this stream without cancelling transport I/O shared by other streams.
property isWriteComplete
source · line 33public val isWriteComplete: Boolean
get: public read-only
Whether output END_STREAM was submitted.
getter get
source · line 33get(): Boolean
function readInto
source · line 59public override suspend fun readInto(buffer: NativeByteBuffer, count: Long): Long
- Overrides
readInto
Reads this stream's body and returns flow-control credit for bytes actually consumed.
parameter buffer
source · line 59buffer: NativeByteBuffer
parameter count
source · line 59count: Long
function finish
source · line 77public suspend fun finish(trailers: List<HttpField> = ArrayList<HttpField>()): Unit
Submits optional trailers and ends this stream's output direction.
parameter trailers
source · line 77trailers: List<HttpField> = ArrayList<HttpField>()
property failure
source · line 25public val failure: Throwable?
get: public read-only
The retained stream failure, if one occurred.
getter get
source · line 25get(): Option<Throwable>
function flush
source · line 72public override suspend fun flush(): Unit
- Overrides
flush
Waits for accepted stream output to be written, including window availability, and completes the underlying transport flush.
property isReadComplete
source · line 29public val isReadComplete: Boolean
get: public read-only
Whether the input ended and all queued body bytes were consumed.
getter get
source · line 29get(): Boolean
property id
source · line 17public val id: Int
get: public read-only
The protocol stream identifier.
getter get
source · line 17get(): Int
function writeFrom
source · line 65public override suspend fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom
Writes body bytes subject to peer flow-control windows and bounded pending output.
parameter count
source · line 65count: Long
parameter buffer
source · line 65buffer: NativeByteBuffer
function sendResponse
source · line 49public suspend fun sendResponse(head: HttpResponseHead, endStream: Boolean = true): Unit
Sends a server response head, optionally closing the output direction immediately.
parameter head
source · line 49head: HttpResponseHead
parameter endStream
source · line 49endStream: Boolean = true
property firstResponseByteAt
source · line 21public val firstResponseByteAt: TimeMark?
get: public read-only
The first response-byte time when timing collection is enabled.
getter get
source · line 21get(): Option<TimeMark>
property trailers
source · line 37public val trailers: Array<HttpField>?
get: public read-only
Complete input trailers after the input ended and all queued body bytes were consumed.
getter get
source · line 37get(): Option<Array<HttpField>>