package dns-forward

  1. Overview
  2. Docs

Construct an RPC client given a Flow and a method of Framing messages over the flow.

Parameters

module Flow : Flow.Client with type address = Ipaddr.t * int
module Framing : Framing.S with type flow = Flow.flow
module Time : V1_LWT.TIME

Signature

type t

A Remote Procedure Call client which can send requests to a server and receive responses.

type request = Cstruct.t

A complete request

type response = Cstruct.t

A complete response

type address = Config.Address.t

The address of the remote endpoint

type message_cb = ?src:address -> ?dst:address -> buf:Cstruct.t -> unit -> unit Lwt.t

A callback called per message, which permits recording and analysis. If an address is unknown (e.g. it is selected by the kernel when routing the packets) then the corresponding argument will be omitted

val connect : ?message_cb:message_cb -> address -> t Error.t

Connect to the remote server

val rpc : t -> request -> response Error.t

Send a request and await a response. Multiple threads may call this in parallel and it is the implementation's job to associate the right response with the original request.

val disconnect : t -> unit Lwt.t

Disconnect from the server and free all resources.

OCaml

Innovation. Community. Security.