package sonet

  1. Overview
  2. Docs
type t
val create : unit -> t
type handle
type error = Unix.error * string * string
type conn_callbacks = {
  1. accept_callback : t -> handle -> Unix.file_descr -> Unix.sockaddr -> unit;
  2. connect_callback : t -> handle -> unit;
  3. error_callback : t -> handle -> error -> unit;
  4. recv_ready_callback : t -> handle -> Unix.file_descr -> unit;
  5. send_ready_callback : t -> handle -> Unix.file_descr -> unit;
}
val handle_compare : handle -> handle -> int
val handle_hash : handle -> int
val register_conn : t -> Unix.file_descr -> ?enable_send:bool -> ?enable_recv:bool -> conn_callbacks -> handle
val remove_conn : t -> handle -> unit
val get_fd : t -> handle -> Unix.file_descr
val connect : t -> handle -> Unix.sockaddr -> unit
val listen : t -> handle -> unit
val enable_send : t -> handle -> unit
val disable_send : t -> handle -> unit
val enable_recv : t -> handle -> unit
val disable_recv : t -> handle -> unit
val set_callbacks : t -> handle -> conn_callbacks -> unit
type timer
val start_timer : t -> float -> (unit -> unit) -> timer
val cancel_timer : t -> timer -> unit
val timer_compare : timer -> timer -> int
val timer_hash : timer -> int
val dispatch : t -> float -> unit
val has_timers : t -> bool
val has_connections : t -> bool
OCaml

Innovation. Community. Security.