Scoop API

scoop:scoop.http.asyncio:0.1.0

AsyncHttp1Connection

class AsyncHttp1Connection

source · line 46
public
public class AsyncHttp1Connection internal constructor(
    internal val state: H1State
) : AsyncCloseable

An HTTP/1 client or server over an already-established asynchronous transport. It owns transport cleanup and serializes each direction. Complete each message body before reusing that direction or transferring an upgraded transport.

function sendResponse

source · line 169
public
public suspend fun sendResponse(head: HttpResponseHead, bytes: Array<Byte>, count: Long = bytes.size, writeIdle: Duration? = ioTimeouts.writeIdle, progress: Http1ResponseProgress? = None): Unit

Sends an immutable byte prefix through the connection's reusable output buffer. Optional progress remains readable after success or failure and excludes response-header bytes.

function sendResponse

source · line 148
public
public suspend fun sendResponse(head: HttpResponseHead, body: Http1BodyFraming = Http1BodyFraming.Empty, writeIdle: Duration? = ioTimeouts.writeIdle): AsyncHttp1Writer

Begins a server response with explicit body framing and returns its writer.

property isReusable

source · line 119
public
public val isReusable: Boolean

get: public read-only

Whether both message directions and protocol state currently allow another exchange on this connection.

function takeTransport

source · line 198
public
public suspend fun takeTransport(): HttpTransport

Transfers ownership after a completed protocol-switch boundary, preserving all already-read suffix bytes.

function sendResponse

source · line 157
public
public suspend fun sendResponse(head: HttpResponseHead, buffer: NativeByteBuffer, count: Long = buffer.readableBytes, writeIdle: Duration? = ioTimeouts.writeIdle): Unit

Sends and completes a response with an already-buffered body. The source cursor records actual body progress, including a prefix accepted before failure.

function sendRequest

source · line 140
public
public suspend fun sendRequest(head: HttpRequestHead, body: Http1BodyFraming = Http1BodyFraming.Empty, writeIdle: Duration? = ioTimeouts.writeIdle): AsyncHttp1Writer

Begins a client request with explicit body framing and returns its writer. Finish the writer even for an empty body.

property pendingResponseFirstByteAt

source · line 108
public
public val pendingResponseFirstByteAt: TimeMark?

get: public read-only

The captured first-byte time of the pending response, when timing collection is enabled and input has arrived.

function close

source · line 202
public
public override suspend fun close(): Unit

Closes the connection and waits for owned transport I/O and cleanup.