Up

module Conduit

: sig

Interface for establishing reliable stream-oriented connections.

This library abstracts the concerns of establishing connections to peers that may be running within the same host (e.g. in another virtual machine) or on a remote host via TCP. It consists of one library that is responsible for establishing individual connections, and a name resolver that maps URIs to endpoints.

#

Connection Establishment

Connections are created by identifying remote nodes using an endp value. To ensure portability, the endp values are translated into concrete connections by separate modules that target Lwt_unix, Async and Mirage. This lets those backends use the appropriate local technique for creating the connection (such as using OpenSSL on Unix, or a pure OCaml TLS+TCP implementation on Mirage, or some other combination).

The modules dealing with connection establishment are:

Conduit_lwt_unix
[root:Conduit_async]
[root:Conduit_mirage]
#

Name Resolution

This deals with resolving URIs into a list of endp addresses that can then be connected to by the connection establishment modules.

All of the name resolvers conform to the [root:RESOLVER] module type. The OS-specific implementations of this interface are:

Resolver_lwt
Resolver_lwt_unix
[root:Resolver_mirage]
#
type endp = [
| `TCP of Ipaddr.t * int
| `Unix_domain_socket of string
| `Vchan_direct of int * string
| `Vchan_domain_socket of string * string
| `TLS of string * endp
| `Unknown of string
]

End points that can potentially be connected to. These are typically returned by a call to a resolver.

#
module type IO = sig

Module type for cooperative threading that can be satisfied by Lwt or Async

#
type +'a t
#
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
#
val return : 'a -> 'a t
end
#
val endp_of_sexp : Sexplib.Sexp.t -> endp
#
val __endp_of_sexp__ : Sexplib.Sexp.t -> endp
#
val sexp_of_endp : endp -> Sexplib.Sexp.t
end