package dns-client

  1. Overview
  2. Docs
DNS resolver API

Install

Dune Dependency

Authors

Maintainers

Sources

dns-6.3.0.tbz
sha256=dc40237a737d1088b83ec5c26437af9843c3692e316c449b71b07ba458307351
sha512=4716559298ab5c5c47bcb94f3614ea3309033a710469ca2a16e1eda8012b596897a9f26007ed8fb360e6119cf94e88c4ae7e74137863959a4c54aa9983277020

doc/dns-client.unix/Dns_client_unix/Transport/index.html

Module Dns_client_unix.TransportSource

A flow module based on blocking I/O on top of the Unix socket API.

TODO: Implement the connect timeout.

Sourcetype context

A context is a network connection initialized by T.connect

Sourcetype +'a io = 'a

io is the type of an effect. 'err is a polymorphic variant.

Sourcetype io_addr = Ipaddr.t * int

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.

Sourcetype stack = unit

A stack with which to connect.

Sourcetype t

The abstract state of a DNS client.

Sourceval create : ?nameservers:(Dns.proto * io_addr list) -> timeout:int64 -> stack -> t

create ~nameservers ~timeout stack creates the state record of the DNS client. We use timeout (ns) as a cumulative time budget for connect and request timeouts.

Sourceval nameservers : t -> Dns.proto * io_addr list

The address of a nameservers that is supposed to work with the underlying context, can be used if the user does not want to bother with configuring their own.

Sourceval rng : int -> Cstruct.t

rng t is a random number generator.

Sourceval clock : unit -> int64

clock t is the monotonic clock.

Sourceval connect : t -> (context, [> `Msg of string ]) result io

connect addr is a new connection (context) to addr, or an error.

Sourceval send_recv : context -> Cstruct.t -> (Cstruct.t, [> `Msg of string ]) result io

send_recv context buffer sends buffer to the context upstream, and then reads a buffer.

Sourceval close : context -> unit io

close context closes the context, freeing up resources.

Sourceval bind : 'a io -> ('a -> 'b io) -> 'b io

a.k.a. >>=

Sourceval lift : 'a -> 'a io
OCaml

Innovation. Community. Security.