package async_websocket

  1. Overview
  2. Docs

Module WebsocketSource

Sourcemodule Opcode : sig ... end
Sourcemodule Connection_close_reason : sig ... end
Sourcemodule Frame_reader = Frame.Frame_reader
Sourcemodule Frame : sig ... end
Sourcemodule Iobuf_writer = Frame.Iobuf_writer
Sourcemodule Content_reassembler : sig ... end

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

Sourcetype t
Sourceval sec_websocket_accept_header_value : sec_websocket_key:string -> string
Sourcemodule Websocket_role : sig ... end
Sourceval create : ?opcode:[ `Text | `Binary ] -> role:Websocket_role.t -> Async.Reader.t -> Async.Writer.t -> t
Sourceval pipes : t -> string Async.Pipe.Reader.t * string Async.Pipe.Writer.t
Sourceval transport : t -> Async_rpc_kernel.Rpc.Transport.t
Sourceval close_finished : t -> (Connection_close_reason.t * string * Core.Info.t option) Async.Deferred.t
Sourceval frame_received : t -> (Opcode.t -> unit) Bus.Read_only.t
Sourceval send_ping : t -> string -> unit
Sourceval 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.