package async_websocket

  1. Overview
  2. Docs
module Read_result : sig ... end
type t
val create : frame_handler: (opcode:Opcode.t -> final:bool -> content:(Core.read, Iobuf.no_seek) Iobuf.t -> masked:[ `Content_was_masked | `Content_was_not_masked ] -> unit) -> t
val consume_frame : t -> (Core.read_write, Iobuf.seek) Iobuf.t -> Read_result.t

The input iobuf will advance by the amount of bytes consumed.

If the frame's content is masked, consume_frame will modify the iobuf inline to unmask it.

val expected_frame_bytes : (Core.read, Iobuf.seek) Iobuf.t -> int option

Useful when we only received a partial frame but still want to know expected the size of the full frame.

val consume_all_available_frames : t -> (Core.read_write, Iobuf.seek) Iobuf.t -> [ `Consumed_as_much_as_possible | `Consumed_until_incomplete_frame | `Cannot_parse_uint64_length ]
module Expert : sig ... end
OCaml

Innovation. Community. Security.