package dns-client-mirage

  1. Overview
  2. Docs
type t
type stack = S.t
type flow = S.TCP.flow
type getaddrinfo = [ `A | `AAAA ] -> [ `host ] Domain_name.t -> (Ipaddr.Set.t, [ `Msg of string ]) result Lwt.t
val create : ?happy_eyeballs:Happy_eyeballs.t -> ?getaddrinfo:getaddrinfo -> ?timer_interval:int64 -> stack -> t
val inject : t -> getaddrinfo -> unit

inject t getaddrinfo injects a new domain-name resolver into the given happy-eyeballs instance. By default, the happy-eyeballs instance is not able to resolve hostnames. Use a dns-client-mirage instance at your convenience.

val connect_host : t -> ?aaaa_timeout:int64 -> ?connect_delay:int64 -> ?connect_timeout:int64 -> ?resolve_timeout:int64 -> ?resolve_retries:int -> [ `host ] Domain_name.t -> int list -> ((Ipaddr.t * int) * flow, [> `Msg of string ]) result Lwt.t

connect_host t host ports establishes a connection to host on ports (tried in sequence). The timeouts and delays are specified in nanoseconds, and are by default the values defined when constructing t.

val connect_ip : t -> ?aaaa_timeout:int64 -> ?connect_delay:int64 -> ?connect_timeout:int64 -> (Ipaddr.t * int) list -> ((Ipaddr.t * int) * flow, [> `Msg of string ]) result Lwt.t

connect_ip t addresses establishes a connection to addresses. The timeouts and delays are specified in nanoseconds, and are by default the values defined when constructing t.

  • raises Failure

    if addresses is the empty list.

val connect : t -> ?aaaa_timeout:int64 -> ?connect_delay:int64 -> ?connect_timeout:int64 -> ?resolve_timeout:int64 -> ?resolve_retries:int -> string -> int list -> ((Ipaddr.t * int) * flow, [> `Msg of string ]) result Lwt.t

connect t host ports establishes a connection to host on ports, which may be a host name, or an IP address. The timeouts and delays are specified in nanoseconds, and are by default the values defined when constructing t.

  • raises Failure

    if ports is the empty list.

OCaml

Innovation. Community. Security.