package happy-eyeballs-miou-unix
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=b2554588302931ba85e18861e610a3ada7823496d4d49a195e953556c351d269
sha512=947f78b27b0e16328b2db8e894f4dfeeae5183297d1860bb8ab214dad8a4c1a7243fecd8db538a8f7d9979ca5c8f22a5a21012907258a4ae6b0e975758bb61b3
doc/happy-eyeballs-miou-unix/Happy_eyeballs_miou_unix/index.html
Module Happy_eyeballs_miou_unix
Source
val create :
?happy_eyeballs:Happy_eyeballs.t ->
?getaddrinfo:getaddrinfo ->
?timer_interval:int64 ->
unit ->
daemon * t
make ()
allocates a new happy-eyeballs daemon in parallel which must be de-allocated with kill
at the end of your whole process. Otherwise, Miou will complain that some tasks still exist. You can check Happy_eyeballs.create
for more informations about optional arguments.
The happy-eyeball stack is able to give a connected socket only from IP addresses. It does not (yet) resolve domain-names. Only connect_ip
is usable. If you have a getaddrinfo
function, you can then inject it into the happy-eyeball daemon to enable it to resolve domain names.
inject t getaddrinfo
injects a DNS resolver into the given happy-eyeballs t
instance. Initially, the happy-eyeballs instance (created by create
) can not resolve domain-name. When the user is able to resolve a domain-name (via the DNS protocol for example), he/she can inject its resolver into the happy-eyeballs instance.
Only after injection the user can use connect_host
and connect
.
val connect_ip :
?aaaa_timeout:int64 ->
?connect_delay:int64 ->
?connect_timeout:int64 ->
t ->
(Ipaddr.t * int) list ->
((Ipaddr.t * int) * Miou_unix.file_descr, [> `Msg of string ]) result
connect_ip t addresses
establishes a connection to addresses
. The timeouts and delays are specified in nanoseconds, and are by default the value defined when constructing t
.
val connect_host :
?aaaa_timeout:int64 ->
?connect_delay:int64 ->
?connect_timeout:int64 ->
?resolve_timeout:int64 ->
?resolve_retries:int ->
t ->
[ `host ] Domain_name.t ->
int list ->
((Ipaddr.t * int) * Miou_unix.file_descr, [> `Msg of string ]) result
connect_host t host ports
establishes a connection to host
on ports
(tried in sequence).
val connect :
?aaaa_timeout:int64 ->
?connect_delay:int64 ->
?connect_timeout:int64 ->
?resolve_timeout:int64 ->
?resolve_retries:int ->
t ->
string ->
int list ->
((Ipaddr.t * int) * Miou_unix.file_descr, [> `Msg of string ]) result
connect t host ports
establishes a connection to host
on ports
, which may be a host name or an IP address.