Polymarket_ws.FrameWebSocket frame encoding and decoding (RFC 6455).
This module implements the binary frame format for WebSocket messages. Client frames must be masked; server frames are unmasked.
module Opcode : sig ... endmodule Close_code : sig ... endA WebSocket frame
val encode : mask:bool -> t -> stringEncode a frame for sending. Client frames should use mask:true.
val decode : _ Eio.Flow.source -> (t, string) Stdlib.resultDecode a frame from a flow. Blocks until a complete frame is received. Returns Error msg if the frame is too large or has invalid encoding.
val text : ?fin:bool -> string -> tCreate a text frame.
val binary : ?fin:bool -> string -> tCreate a binary frame.
val ping : ?payload:string -> unit -> tCreate a ping frame.
val pong : ?payload:string -> unit -> tCreate a pong frame.
val close : ?code:Close_code.t -> ?reason:string -> unit -> tCreate a close frame.