package dream

  1. Overview
  2. Docs
type t
type input_handlers = {
  1. frame : opcode:Websocket.Opcode.t -> is_fin:bool -> Bigstringaf.t -> off:int -> len:int -> unit;
  2. eof : unit -> unit;
}
type error = [
  1. | `Exn of exn
]
type error_handler = Wsd.t -> error -> unit
val create : sha1:(string -> string) -> ?error_handler:error_handler -> (Wsd.t -> input_handlers) -> t
val create_websocket : ?error_handler:error_handler -> (Wsd.t -> input_handlers) -> t
val next_read_operation : t -> [ `Read | `Yield | `Close ]
val next_write_operation : t -> [ `Write of Bigstringaf.t IOVec.t list | `Yield | `Close of int ]
val read : t -> Bigstringaf.t -> off:int -> len:int -> int
val read_eof : t -> Bigstringaf.t -> off:int -> len:int -> int
val report_write_result : t -> [ `Ok of int | `Closed ] -> unit
val report_exn : t -> exn -> unit
val yield_reader : t -> (unit -> unit) -> unit
val yield_writer : t -> (unit -> unit) -> unit
val is_closed : t -> bool
val shutdown : t -> unit
OCaml

Innovation. Community. Security.