package async_websocket

  1. Overview
  2. Docs
type t
type partial_frame_handler = opcode:Opcode.t -> final:bool -> total_frame_payload_len:int -> payload_pos:int -> payload_fragment:(Core.read, Iobuf.seek) Iobuf.t -> masked:[ `Payload_was_masked | `Payload_was_not_masked ] -> unit
val create : partial_frame_handler:partial_frame_handler -> t
val consume_frame_even_if_incomplete_payload : t -> (Core.read_write, Iobuf.seek) Iobuf.t -> Read_result.t

consume_frame_even_if_incomplete_payload is useful for consuming payload data when: (i) the full frame payload is not available in the input iobuf (e.g. we haven't received the full frame yet); and (ii) the caller's ability to consume payload is limited (e.g. the downstream app buffer can't be resized)

It's meant to be invoked repeately on the same iobuf whenever there's more input data, or whenever the caller can handle more payload data.

OCaml

Innovation. Community. Security.