package tcpip

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

Innovation. Community. Security.