ConnectionFacade Type

Constructors

Constructor Description

ConnectionFacade(connection, runtime, connectionPool, tracker, cancellationToken, webpart)

Full Usage: ConnectionFacade(connection, runtime, connectionPool, tracker, cancellationToken, webpart)

Parameters:
Returns: ConnectionFacade
connection : Connection
runtime : HttpRuntime
connectionPool : ConcurrentPool<ConnectionFacade>
tracker : ActiveConnectionTracker<ConnectionFacade>
cancellationToken : CancellationToken
webpart : WebPart
Returns: ConnectionFacade

Instance members

Instance member Description

this.Connection

Full Usage: this.Connection

this.ConnectionId

Full Usage: this.ConnectionId

Returns: int64
Returns: int64

this.Runtime

Full Usage: this.Runtime

this.Webpart

Full Usage: this.Webpart

Returns: WebPart

The web part used to serve requests on this connection. Exposed so that protocol upgrade handlers (e.g. h2c) can drive their own request loop using the same web part as the HTTP/1.1 keep-alive loop.

Returns: WebPart

this.accept binding

Full Usage: this.accept binding

Parameters:
Returns: Task<unit>
binding : SocketBinding
Returns: Task<unit>

this.exitHttpLoopWithError err

Full Usage: this.exitHttpLoopWithError err

Parameters:
Returns: Task<Result<bool, 'a>>
err : Error
Returns: Task<Result<bool, 'a>>

this.parsePostData maxContentLength contentLengthHeader contentTypeHeader

Full Usage: this.parsePostData maxContentLength contentLengthHeader contentTypeHeader

Parameters:
    maxContentLength : int
    contentLengthHeader : Choice<string, 'a>
    contentTypeHeader : Choice<string, 'b>

Returns: SocketOp<unit>
maxContentLength : int
contentLengthHeader : Choice<string, 'a>
contentTypeHeader : Choice<string, 'b>
Returns: SocketOp<unit>

this.processRequest ()

Full Usage: this.processRequest ()

Returns: Task<Result<bool, Error>>
Returns: Task<Result<bool, Error>>

this.readRequest ()

Full Usage: this.readRequest ()

Returns: SocketOp<HttpRequest>
Returns: SocketOp<HttpRequest>

this.requestLoop ()

Full Usage: this.requestLoop ()

Returns: Task<Result<unit, Error>>

The request loop initialises a request with a processor to handle the incoming stream and possibly pass the request to the web parts, a protocol, a web part, an error handler and a Connection to use for read-write communication -- getting the initial request stream.

Returns: Task<Result<unit, Error>>

this.shutdown ()

Full Usage: this.shutdown ()

Static members

Static member Description

ConnectionFacade.Http2PriorKnowledgeHandler

Full Usage: ConnectionFacade.Http2PriorKnowledgeHandler

Optional hook invoked when an incoming cleartext connection opens with the HTTP/2 connection preface ("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n") per RFC 7540 §3.4 (prior-knowledge mode). When set, the hook owns the connection from this point forward: it must consume the remainder of the preface (the request line "PRI * HTTP/2.0\r\n" has already been read by `readRequest`) and drive the HTTP/2 protocol. Returning `Ok false` terminates the HTTP/1.1 keep-alive loop; any error is propagated to `accept`. The hook is registered by `Suave.Http2.H2cPriorKnowledge.register` from `Tcp.fs` at server startup so that `ConnectionFacade.fs` need not take a forward dependency on `Http2.fs` (which is compiled later).

ConnectionFacade.Http2UpgradeHandler

Full Usage: ConnectionFacade.Http2UpgradeHandler

Optional hook invoked when an incoming HTTP/1.1 request asks to upgrade to HTTP/2 cleartext (h2c) per RFC 7540 §3.2. When set, the hook owns the connection from this point forward (it is responsible for writing the 101 Switching Protocols response and then driving the HTTP/2 protocol). Returning `Ok false` terminates the HTTP/1.1 keep-alive loop; any error is propagated to `accept`. The hook is registered by `Suave.Http2.H2cUpgrade.register` from `Tcp.fs` at server startup so that `ConnectionFacade.fs` need not take a forward dependency on `Http2.fs` (which is compiled later).