package async_websocket

  1. Overview
  2. Docs
module Opcode : sig ... end
module Connection_close_reason : sig ... end
module Frame_reader = Frame.Frame_reader
module Frame : sig ... end
module Iobuf_writer = Frame.Iobuf_writer
module Content_reassembler : sig ... end

Content_reassembler can process fragmented content from websocket frames and reassemble fragmented content into a contiguous buffer.

type t
val sec_websocket_accept_header_value : sec_websocket_key:string -> string
module Websocket_role : sig ... end
val create : ?opcode:[ `Text | `Binary ] -> role:Websocket_role.t -> Async.Reader.t -> Async.Writer.t -> t
val pipes : t -> string Async.Pipe.Reader.t * string Async.Pipe.Writer.t
val close_finished : t -> (Connection_close_reason.t * string * Core.Info.t option) Async.Deferred.t
val frame_received : t -> (Opcode.t -> unit) Bus.Read_only.t
val send_ping : t -> string -> unit
val monitor_pongs : ?time_source:Async.Time_source.t -> ping_every:Core.Time_ns.Span.t -> concerning_pong_response_delay:Core.Time_ns.Span.t -> on_concerning_pong_response_delay:(unit -> unit) -> t -> unit

Listen for pongs frames, and report when it has been too long since the last pong frame. Since pong frames don't typically arrive unsolicited (though it is legal if they do), we send ping frames at the specified interval.

OCaml

Innovation. Community. Security.