package websocketml

  1. Overview
  2. Docs
exception WSError of string
exception NotImplemented of string
type opcode =
  1. | ContinuationFrame
  2. | TextFrame
  3. | BinaryFrame
  4. | Close
  5. | Ping
  6. | Pong
  7. | ControlFrame of int
  8. | NonControlFrame of int
val int_of_opcode : opcode -> int
val opcode_of_int : int -> opcode
val string_of_opcode : opcode -> string
val is_controlop : opcode -> bool
type exit_code =
  1. | NormalClosure
  2. | GoingAway
  3. | ProtocolError
  4. | UnkownDatatype
  5. | NoStatusCode
  6. | AbnormalClosure
  7. | InconsistentData
  8. | PolicyViolation
  9. | MsgTooBig
  10. | RequiredExtension
  11. | UnexpectedCondition
  12. | TLSFailure
  13. | ReservedCode of int
  14. | CustomCode of int
val reserved_exit_code : exit_code -> bool
val int_of_exit_code : exit_code -> int
val exit_code_of_int : int -> exit_code
type frame = {
  1. fin : bool;
  2. opcode : opcode;
  3. frame_data : bytes;
}
type msg_type =
  1. | BinaryMsg
  2. | TextMsg
type msg = {
  1. msg_typ : msg_type;
  2. msg_data : bytes;
}
type client = {
  1. addr : Unix.sockaddr;
  2. sock : Unix.file_descr;
}
val string_of_client : client -> string
type t = {
  1. client : client;
  2. mutable closed_out : bool;
  3. mutable closed_in : bool;
}
val to_string : t -> string
val print_t : out_channel -> t -> unit
val warn : exn -> unit
val create : (Unix.file_descr * Unix.sockaddr) -> t
val get_sock : t -> Unix.file_descr
val get_addr : t -> Unix.sockaddr
val closed_out : t -> bool
val closed_in : t -> bool
val closed : t -> bool
val recv_bytes : t -> bytes -> int -> int -> int
val send_bytes : t -> bytes -> int
val build_frame : opcode -> bytes -> bytes
val build_msg : opcode -> bytes -> bytes
val send_msg : t -> opcode -> bytes -> int
val send_ping : t -> bytes -> int
val send_pong : t -> bytes -> int
val send_close : t -> bytes -> int
val send_text : t -> string -> int
val send_binary : t -> bytes -> int
val close_with_message : t -> exit_code -> string -> int
val close : t -> exit_code -> int
val do_close : t -> frame -> int
val receive_frame : t -> frame
val receive_message : t -> msg option
OCaml

Innovation. Community. Security.