Http2Connection Type

Constructors

Constructor Description

Http2Connection(facade)

Full Usage: Http2Connection(facade)

Parameters:
Returns: Http2Connection
facade : ConnectionFacade
Returns: Http2Connection

Instance members

Instance member Description

this.applyPeerSettings newSettings

Full Usage: this.applyPeerSettings newSettings

Parameters:
Returns: Async<unit>

Apply a non-ACK SETTINGS frame from the peer and emit a SETTINGS-ACK. Also adjusts every outbound stream window by the delta between the old and new SETTINGS_INITIAL_WINDOW_SIZE (RFC 7540 §6.9.2).

newSettings : Settings
Returns: Async<unit>

this.decodeDynamicTable

Full Usage: this.decodeDynamicTable

Returns: DynamicTable
Returns: DynamicTable

this.dispatchUpgradeRequest originalRequest webPart

Full Usage: this.dispatchUpgradeRequest originalRequest webPart

Parameters:
Returns: Async<unit>

Build a synthetic stream-1 from the original h2c upgrade request and dispatch it to the webpart. RFC 7540 §3.2: stream 1 is implicitly half-closed from the client toward the server (the request body has been fully delivered as the HTTP/1.1 upgrade request).

originalRequest : HttpRequest
webPart : WebPart
Returns: Async<unit>

this.encodeDynamicTable

Full Usage: this.encodeDynamicTable

Returns: DynamicTable
Returns: DynamicTable

this.get ()

Full Usage: this.get ()

Returns: Async<Message<HttpRequest>>
Returns: Async<Message<HttpRequest>>

this.read ()

Full Usage: this.read ()

Returns: SocketOp<Frame>
Returns: SocketOp<Frame>

this.readRaw ()

Full Usage: this.readRaw ()

Returns: SocketOp<FrameHeader * byte[]>

Read the next frame as (header, raw payload bytes), without invoking a per-type decoder. The dispatcher runs `validateFrame` against the raw form first so that malformed inputs surface as proper GOAWAY/RST_STREAM frames instead of asserting inside a decoder.

Returns: SocketOp<FrameHeader * byte[]>

this.resetStream streamId errorCode

Full Usage: this.resetStream streamId errorCode

Parameters:
Returns: Async<unit>

Reset a single stream with the given error code. Stream-level failures don't tear down the connection.

streamId : int32
errorCode : ErrorCode
Returns: Async<unit>

this.run originalRequest webPart

Full Usage: this.run originalRequest webPart

Parameters:
Returns: Async<Result<unit, Error>>

Top-level entry point used by the h2c upgrade handler. Runs the connection preface, optionally dispatches a seeded upgrade request on stream 1, then enters the read/dispatch loop until the connection is closed.

originalRequest : HttpRequest option
webPart : WebPart
Returns: Async<Result<unit, Error>>

this.runPriorKnowledge webPart

Full Usage: this.runPriorKnowledge webPart

Parameters:
Returns: Async<Result<unit, Error>>

Top-level entry point used by the HTTP/2 prior-knowledge handler. The request-line portion of the preface has already been consumed by the HTTP/1.1 request-line reader; this runs the rest of the preface exchange and then enters the read/dispatch loop until the connection is closed.

webPart : WebPart
Returns: Async<Result<unit, Error>>

this.runReadLoop webPart

Full Usage: this.runReadLoop webPart

Parameters:
Returns: Async<unit>

Read frames in a loop, dispatching each to `handleFrame`, until either our connection is torn down (GOAWAY sent/received) or the transport reports an error. Returns when the loop terminates so the caller can recycle the connection.

webPart : WebPart
Returns: Async<unit>

this.send r

Full Usage: this.send r

Parameters:
r : HttpRequest

this.sendGoAwayAndStop errorCode

Full Usage: this.sendGoAwayAndStop errorCode

Parameters:
Returns: Async<unit>

Send a connection-level GOAWAY and stop the read loop. Idempotent.

errorCode : ErrorCode
Returns: Async<unit>

this.start ()

Full Usage: this.start ()

Returns: SocketOp<unit>
 Run the HTTP/2 connection-preface exchange (RFC 7540 §3.5):
   * read the 24-byte client preface ("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n")
   * send our own (potentially empty) SETTINGS frame as the server
     connection preface
Returns: SocketOp<unit>

this.startPriorKnowledge ()

Full Usage: this.startPriorKnowledge ()

Returns: SocketOp<unit>

Run the HTTP/2 connection-preface exchange for prior-knowledge mode (RFC 7540 §3.4). The caller has already consumed the first 16 bytes of the 24-byte preface as an HTTP/1.1-looking request line ("PRI * HTTP/2.0\r\n") via the normal request-line reader. This method reads the remaining 8 preface bytes ("\r\nSM\r\n\r\n") and sends our own (potentially empty) SETTINGS frame as the server connection preface.

Returns: SocketOp<unit>

this.stop ()

Full Usage: this.stop ()

this.write (encInfo, p)

Full Usage: this.write (encInfo, p)

Parameters:
Returns: SocketOp<unit>
encInfo : EncodeInfo
p : FramePayload
Returns: SocketOp<unit>

this.writeLoop ctxOuter webPart

Full Usage: this.writeLoop ctxOuter webPart

Parameters:
Returns: Async<unit>
ctxOuter : HttpContext
webPart : WebPart
Returns: Async<unit>

this.writeResponseOnStream streamId response trailers

Full Usage: this.writeResponseOnStream streamId response trailers

Parameters:
    streamId : int32
    response : HttpResult
    trailers : (string * string) list

Returns: Async<unit>

Write a single HTTP/2 response (HEADERS + 0..n DATA + optional trailing HEADERS) on `streamId`, respecting `peerSettings.maxFrameSize` and the outbound flow-control windows. Setting trailers via `Trailers.set` on the response context is honoured: when present, the final DATA frame does NOT set END_STREAM and a trailing HEADERS frame with END_STREAM is emitted after the body.

streamId : int32
response : HttpResult
trailers : (string * string) list
Returns: Async<unit>

this.writeResponseToFrame response

Full Usage: this.writeResponseToFrame response

Parameters:
Returns: Async<unit>
response : HttpResult
Returns: Async<unit>