package happy-eyeballs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Happy_eyeballsSource

Sourcetype t

The internal state of happy eyeballs.

Sourcetype action =
  1. | Resolve_a of [ `host ] Domain_name.t
  2. | Resolve_aaaa of [ `host ] Domain_name.t
  3. | Connect of [ `host ] Domain_name.t * int * Ipaddr.t * int
  4. | Connect_failed of [ `host ] Domain_name.t * int

The variant of actions to be performed by the effectful layer.

Sourceval pp_action : action Fmt.t

pp_action ppf a pretty-prints the action a on ppf.

Sourcetype event =
  1. | Resolved_a of [ `host ] Domain_name.t * Ipaddr.V4.Set.t
  2. | Resolved_aaaa of [ `host ] Domain_name.t * Ipaddr.V6.Set.t
  3. | Resolved_a_failed of [ `host ] Domain_name.t
  4. | Resolved_aaaa_failed of [ `host ] Domain_name.t
  5. | Connection_failed of [ `host ] Domain_name.t * int * Ipaddr.t * int
  6. | Connected of [ `host ] Domain_name.t * int * Ipaddr.t * int

The variant of events.

Sourceval pp_event : event Fmt.t

pp_event ppf e pretty-prints event e on ppf.

Sourceval create : ?aaaa_timeout:int64 -> ?connect_timeout:int64 -> ?resolve_timeout:int64 -> int64 -> t

create ~aaaa_timeout ~connect_timeout ~resolve_timeout ts creates the internal state, initialized with the timestamp ts (an arbitrary number that must be monotonically increasing). The timeouts are specified in nanoseconds: the default of aaaa_timeout is Duration.of_ms 50, connect_timeout and resolve_timeout use a default of Duration.of_sec 1.

Sourceval timer : t -> int64 -> t * [ `Suspend | `Act of action list ]

timer t ts is a timer function that results in an updated t and either `Suspend signalling the timer thread can sleep or `Act actions a list of actions that need to be performed (connection to be retried, connection failures to be reported, ...). The timer thread should be signalled to resume after calling connect or connect_ip.

Sourceval connect : t -> int64 -> id:int -> [ `host ] Domain_name.t -> int list -> t * action list

connect t ts ~id host ports attempts a connection to host, where the ports are attempted in sequence. It results in an updated t and a list of actions to be performed.

  • raises Failure

    if ports is the empty list.

Sourceval connect_ip : t -> int64 -> id:int -> (Ipaddr.t * int) list -> t * action list

connect_ip t ts ~id addresses attempts a connection to addresses. By default, the list will be tried in sequence. The ports will be tried in sequence. The result is an updated t and a list of actions to be performed.

  • raises Failure

    if addresses is the empty list.

Sourceval event : t -> int64 -> event -> t * action list

event t ts ev results in an updated t and a list of actions to be performed.

  • raises Failure

    if ev contains an empty set of IP addresses.

Sourcemodule Waiter_map : sig ... end

A map for waiters and internal id.

OCaml

Innovation. Community. Security.