package capnp-rpc-unix

  1. Overview
  2. Docs
Module type
Class type

Helpers for using Capnp_rpc_lwt on traditional operating systems.

module Listen_address : sig ... end
module Connect_address : sig ... end
val endpoint_of_socket : switch:Lwt_switch.t -> Lwt_unix.file_descr -> Capnp_rpc_lwt.Endpoint.t

endpoint_of_socket ~switch fd is an endpoint that sends and receives on fd. When switch is turned off, fd is closed.

val serve : ?backlog:int -> ?offer:'a Capnp_rpc_lwt.Capability.t -> Listen_address.t -> 'b Lwt.t

serve ~offer address listens for new connections on address and handles them. Clients can get access to the bootstrap object offer. backlog is passed to Unix.listen.

connect addr connects to the server at addr and returns its bootstrap object. If offer is given, the client will also offer this service to the remote vat. If switch is given then turning it off will disconnect, and disconnecting will turn off the switch.


Innovation. Community. Security.