class AsyncHttp2Connection
source · line 30public class AsyncHttp2Connection internal constructor(internal val state: H2State) : AsyncCloseable
- Supertype
AsyncCloseable
An owned multiplexed HTTP/2 connection driven by structured tasks in the supplied scope. Per-stream cancellation resets only that stream; connection or scope closure ends shared transport I/O.
function close
source · line 158public override suspend fun close(): Unit
- Overrides
close
Cancels and joins shared connection I/O and closes the owned transport. This is local cleanup, distinct from explicitly sending GOAWAY.
function openRequest
source · line 115public suspend fun openRequest(head: HttpRequestHead, endStream: Boolean = true, ioTimeouts: HttpIoTimeoutOptions = this.ioTimeouts): AsyncHttp2Stream
Submits a request and returns its stream. Set endStream false when an upload body or trailers will follow; draining connections reject before submission.
parameter head
source · line 115head: HttpRequestHead
parameter ioTimeouts
source · line 116ioTimeouts: HttpIoTimeoutOptions = this.ioTimeouts
parameter endStream
source · line 115endStream: Boolean = true
property upgradedStream
source · line 107public val upgradedStream: AsyncHttp2Stream?
get: public read-only
Stream 1 associated with a successful h2c upgrade, or None for a connection established directly as HTTP/2.
getter get
source · line 107get(): Option<AsyncHttp2Stream>
property isClosing
source · line 94public val isClosing: Boolean
get: public read-only
Whether connection shutdown has begun, before cleanup completes.
getter get
source · line 94get(): Boolean
function acceptRequest
source · line 138public suspend fun acceptRequest(): Http2IncomingRequest?
Waits for a server-side incoming request, or None after the connection stops accepting requests.
property isDraining
source · line 102public val isDraining: Boolean
get: public read-only
Whether new requests are disallowed while existing streams drain.
getter get
source · line 102get(): Boolean
property role
source · line 86public val role: HttpRole
get: public read-only
The local HTTP client or server role.
getter get
source · line 86get(): HttpRole
property isClosed
source · line 98public val isClosed: Boolean
get: public read-only
Whether connection cleanup has completed.
getter get
source · line 98get(): Boolean
property ioTimeouts
source · line 90public val ioTimeouts: HttpIoTimeoutOptions
get: public read-only
The default I/O idle deadlines used by this connection.
getter get
source · line 90get(): HttpIoTimeoutOptions
function goAway
source · line 144public suspend fun goAway(code: UInt = 0U, debugData: List<Byte> = ArrayList<Byte>(), lastStreamId: Int? = None): Unit
Sends an explicit GOAWAY notification with selected code, debug data, and optional last-stream boundary.
parameter lastStreamId
source · line 144lastStreamId: Int? = None
parameter code
source · line 144code: UInt = 0U
parameter debugData
source · line 144debugData: List<Byte> = ArrayList<Byte>()