Esc

exchange_write

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

Sends bytes, borrowing them until this returns. Half-close sends an empty END_STREAM when bytes are empty. Calls are never automatically replayed.

Signature

exchange_write :: (
    exchange: *Http2_Exchange,
    bytes: [] u8,
    end_stream := false
) -> Client_Error
Example
// A closed handle refuses to write.
exchange: Http2_Exchange;
failure := exchange_write(*exchange, bytes_of("ping"));

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

See also