package websocketml

  1. Overview
  2. Docs
exception WSError of string
type t
type msg_type =
  1. | BinaryMsg
  2. | TextMsg
type msg = {
  1. msg_typ : msg_type;
  2. msg_data : bytes;
}
type opcode =
  1. | ContinuationFrame
  2. | TextFrame
  3. | BinaryFrame
  4. | Close
  5. | Ping
  6. | Pong
  7. | ControlFrame of int
  8. | NonControlFrame of int
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 create : (Unix.file_descr * Unix.sockaddr) -> t
val get_sock : t -> Unix.file_descr
val get_addr : t -> Unix.sockaddr
val receive_message : t -> msg option
val send_msg : t -> opcode -> bytes -> int
val send_ping : t -> bytes -> int
val send_text : t -> string -> int
val send_binary : t -> bytes -> int
val close : t -> exit_code -> int
val close_with_message : t -> exit_code -> string -> int
val closed_in : t -> bool
val closed_out : t -> bool
val closed : t -> bool
val to_string : t -> string
val print_t : Stdlib.out_channel -> t -> unit
module Http : sig ... end
module Logger : sig ... end