package capnp-rpc-net

  1. Overview
  2. Docs

Module Networking.CapTPSource

Sharing capabilities over a network link.

Sourcetype t

A CapTP connection to a remote peer.

Sourceval connect : sw:Eio.Switch.t -> restore:Restorer.t -> ?tags:Logs.Tag.set -> Endpoint.t -> t

connect ~sw ~restore ~switch endpoint is fresh CapTP protocol handler that sends and receives messages using endpoint. restore is used to respond to "Bootstrap" messages. If the connection fails then endpoint will be disconnected. You must call run to run the loop handling messages.

  • parameter sw

    Used to run methods and to run the transmit thread.

Sourceval run : t -> unit

run t reads and handles incoming messages until the connection is finished.

bootstrap t object_id is the peer's bootstrap object object_id, if any. Use object_id = "" for the main, public object.

Sourceval disconnect : t -> Capnp_rpc.Exception.t -> unit

disconnect reason closes the connection, sending reason to the peer to explain why. Capabilities and questions at both ends will break, with reason as the problem.

Sourceval dump : t Fmt.t

dump dumps the state of the connection, for debugging.

OCaml

Innovation. Community. Security.