Esc

exchange_read

procedureextensionexperimentalsince 0.36.1Source
  • macOS: exchange_read works on macOS
  • Linux: exchange_read works on Linux
  • Windows: exchange_read works on Windows
  • Wasm: exchange_read works on Wasm

Reads into caller memory. Zero bytes with no error means validated byte EOF. Window credit follows bytes consumed; no background message queue is created.

Signature

exchange_read :: (
    exchange: *Http2_Exchange,
    buffer: [] u8
) -> (count: int, failure: Client_Error)
Example
// A closed handle has nothing to read.
exchange: Http2_Exchange;
buffer: [16] u8;
count, failure := exchange_read(*exchange, buffer);

assert(count == 0);
assert(failure.kind == .TRANSPORT && failure.detail == "exchange is closed");

See also