Esc

ws_deflate

procedureextensionsince 0.36.1Source
  • macOS: ws_deflate works on macOS
  • Linux: ws_deflate works on Linux
  • Windows: ws_deflate works on Windows
  • Wasm: ws_deflate works on Wasm

Compresses one message for sending as role, with the window that role negotiated (client_max_window_bits for a client, server_max_window_bits for a server). history is the sender's retained context, empty without it. The result is a sync-flushed raw deflate message that must be freed. Example: packed := ws_deflate(.CLIENT, codec.compression, text, .[]).

Signature

ws_deflate :: (
    role: Ws_Role,
    settings: Ws_Deflate,
    data: [] u8,
    history: [] u8
) -> [] u8

See also