package dns-forward

  1. Overview
  2. Docs
type server

A Remote Procedure Call server which will listen on an address, accept incoming connections and answer them

type request = Cstruct.t

A complete request

type response = Cstruct.t

A complete response

type address = Config.Address.t

The address of the server

val bind : address -> server Error.t

Bind to the given address. This will fail if the address does not exist or if another server is already bound there.

val listen : server -> (request -> response Error.t) -> unit Error.t

Listen and accept incoming connections, use the provided callback to answer requests.

val shutdown : server -> unit Lwt.t

Shutdown the server and free any allocated resources.