package dns-client
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=be69bc317369409fc4dfbab1120ced7510313888105a4d13071b962a07e1fd3c
sha512=32082237c7ae922edc63822fe0f6447fb83b9fb40546a196cda4904078b4129e601b4413c95b7c51e012f27c654324e18619ab8aed53969ff07fded13378c2c6
doc/dns-client.unix/Dns_client_unix/Transport/index.html
Module Dns_client_unix.Transport
Source
A flow module based on blocking I/O on top of the Unix socket API.
TODO: Implement the connect timeout.
A context is a network connection initialized by T.connect
io
is the type of an effect. 'err
is a polymorphic variant.
An address for a given context type, usually this will consist of IP address + a TCP/IP or UDP/IP port number, but for some context types it can carry additional information for purposes of cryptographic verification. TODO at least that would be nice in the future. TODO
TODO well this is kind of crude; it's a tuple to prevent having to do endless amounts of currying things when implementing context types, and we need to know the protocol used so we can prefix packets for DNS-over-TCP and set correct socket options etc. therefore we can't just use the opaque io_addr
. TODO
A stack with which to connect, e.g. IPv4.tcpv4
The abstract state of a DNS client.
create ~nameserver ~timeout stack
creates the state record of the DNS client. We use timeout
(ns) as a cumulative time budget for connect and request timeouts.
The address of a nameserver that is supposed to work with the underlying context, can be used if the user does not want to bother with configuring their own.
rng t
is a random number generator.
clock t
is the monotonic clock.
connect addr
is a new connection (context
) to addr
, or an error.
send context buffer
sends buffer
to the context
upstream.
recv context
tries to read a buffer
from the context
downstream.