package conduit

  1. Overview
  2. Docs
A network connection establishment library

Install

Dune Dependency

Authors

Maintainers

Sources

conduit-6.1.0.tbz
sha256=a2e29088630bbef92c1a902192a09548ab4a6b3f75a7eee6722426eca1efc05f
sha512=308041a9cccf5b01827365ae9e75915bf33c812658ff1a802b275827f4c9af98dd991df9106a5b8d70374cc0d41398621bbafd8de829acfef4cb86e6b9523712

doc/conduit/Conduit/index.html

Module ConduitSource

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
  • Conduit_async
  • 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 RESOLVER module type. The OS-specific implementations of this interface are:

  • Resolver_lwt
  • Resolver_lwt_unix
  • Resolver_mirage
Sourcetype endp = [
  1. | `TCP of Ipaddr.t * int
    (*

    IP address and destination port

    *)
  2. | `Unix_domain_socket of string
    (*

    Unix domain file path

    *)
  3. | `Vchan_direct of int * string
    (*

    domain id, port

    *)
  4. | `Vchan_domain_socket of string * string
    (*

    Vchan Xen domain socket

    *)
  5. | `TLS of string * endp
    (*

    Wrap in a TLS channel, hostname,endp

    *)
  6. | `Unknown of string
    (*

    Failed resolution

    *)
]

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

Sourceval sexp_of_endp : endp -> Sexplib0.Sexp.t
Sourceval endp_of_sexp : Sexplib0.Sexp.t -> endp
Sourceval __endp_of_sexp__ : Sexplib0.Sexp.t -> endp
Sourcemodule type IO = sig ... end

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

OCaml

Innovation. Community. Security.