package tcpip

  1. Overview
  2. Docs
type buffer = Cstruct.t
type ip = Ipaddr.V4.t option
type ipaddr = Ipaddr.V4.t
type ipinput = unit Lwt.t
type flow = Lwt_unix.file_descr
type error = [
  1. | `Refused
  2. | `Timeout
  3. | `Unknown of string
]
type 'a io = 'a Lwt.t
val disconnect : t -> unit io
val error_message : error -> string
val read : flow -> [ `Eof | `Error of error | `Ok of buffer ] io
val write : flow -> buffer -> [ `Eof | `Error of error | `Ok of unit ] io
val writev : flow -> buffer list -> [ `Eof | `Error of error | `Ok of unit ] io
val close : flow -> unit io
type callback = flow -> unit io
val get_dest : flow -> ipaddr * int
val write_nodelay : flow -> buffer -> unit io
val writev_nodelay : flow -> buffer list -> unit io
val create_connection : t -> (ipaddr * int) -> [ `Error of error | `Ok of flow ] io
val input : t -> listeners:(int -> callback option) -> ipinput
val connect : ip -> [> `Error of error | `Ok of t ] Lwt.t
OCaml

Innovation. Community. Security.