package h1
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2d3067ed380163920149fbe9149d5bda630b4f45e3c10be793beea06a07c6d3c
sha512=d720e6fbc31f02045fe5a6fad34ec284ef3ae636a52c31f9eb6e4cc74e8fba9a3a91df0b738c8d0bb06e57119d0534d872f3f7ef873f441b4802cc96a98b9528
doc/h1/H1/Client_connection/index.html
Module H1.Client_connectionSource
type error = [ | `Malformed_response of string| `Invalid_response_body_length of Response.t| `Exn of exn
]val request :
?config:Config.t ->
Request.t ->
error_handler:error_handler ->
response_handler:response_handler ->
Body.Writer.t * tnext_read_operation t returns a value describing the next operation that the caller should conduct on behalf of the connection.
read t bigstring ~off ~len reads bytes of input from the provided range of bigstring and returns the number of bytes consumed by the connection. read should be called after next_read_operation returns a `Read value and additional input is available for the connection to consume.
read_eof t bigstring ~off ~len reads bytes of input from the provided range of bigstring and returns the number of bytes consumed by the connection. read_eof should be called after next_read_operation returns a `Read and an EOF has been received from the communication channel. The connection will attempt to consume any buffered input and then shutdown the HTTP parser for the connection.
next_write_operation t returns a value describing the next operation that the caller should conduct on behalf of the connection.
report_write_result t result reports the result of the latest write attempt to the connection. report_write_result should be called after a call to next_write_operation that returns a `Write buffer value.
`Ok nindicates that the caller successfully wrotenbytes of output from the buffer that the caller was provided bynext_write_operation.`Closedindicates that the output destination will no longer accept bytes from the write processor.
yield_writer t continue registers with the connection to call continue when writing should resume. yield_writer should be called after next_write_operation returns a `Yield value.
report_exn t exn reports that an error exn has been caught and that it has been attributed to t. Calling this function will switch t into an error state. Depending on the state t is transitioning from, it may call its error handler before terminating the connection.