package dns-client-lwt

  1. Overview
  2. Docs
DNS client API using lwt

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dns-10.2.0.tbz
sha256=ad27c09256f9848658ee625d69140c898c24694aca43550bfb6fee5bc83e74e8
sha512=d5d6a0580d55485cbe46841fb8d5acd7de801bf6ce980f31888836425e39f23f3ff2e909c5f195b15a36166ae97ecd68d24429318028ae8d1ea9322df2f5a65d

doc/dns-client-lwt/Dns_client_lwt/Transport/index.html

Module Dns_client_lwt.TransportSource

A flow module based on non-blocking I/O on top of the Lwt_unix socket API.

Sourcetype context

A context is a network connection initialized by connect

Sourcetype +'a io = 'a Lwt.t

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

Sourcetype io_addr = [
  1. | `Plaintext of Ipaddr.t * int
  2. | `Tls of Tls.Config.client * 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.

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 -> string

rng t is a random number generator.

Sourceval clock : unit -> int64

clock t is the monotonic clock.

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

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

Sourceval send_recv : context -> string -> (string, [> `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.