package obus

  1. Overview
  2. Docs
Pure Ocaml implementation of the D-Bus protocol

Install

Dune Dependency

Authors

Maintainers

Sources

obus-1.2.5.tar.gz
md5=81eb1034c6ef4421a2368a9b352199de
sha512=4b540497188a7d78f4f14f94c6b7fdff47dd06436a34e650ff378dd77bb3e2acb7afd45cd72daf4ddba06e732e9944d560c2882dc37862f1b1f1bb6df37e6205

doc/obus/OBus_server/index.html

Module OBus_serverSource

Servers for one-to-one communication

Sourcetype t

Type of a server

Sourceval addresses : t -> OBus_address.t list

addresses server returns all the addresses the server is listenning on. These addresses must be passed to clients so they can connect to server.

Sourceval shutdown : t -> unit Lwt.t

shutdown server shutdowns the given server. It terminates when all listeners (a server may listen on several addresses) have exited. If the server has already been shut down, it does nothing.

Sourceval make : ?switch:Lwt_switch.t -> ?capabilities:OBus_auth.capability list -> ?mechanisms:OBus_auth.Server.mechanism list -> ?addresses:OBus_address.t list -> ?allow_anonymous:bool -> (t -> OBus_connection.t -> unit) -> t Lwt.t

make ?switch ?capabilities ?mechanisms ?addresses ?allow_anonymous f Creates a server which will listen on all of the given addresses.

  • parameter capabilites

    is the set of the server's capabilities,

  • parameter mechanisms

    is the list of authentication mechanisms supported by the server,

  • parameter addresses

    default to { name = "unix"; args = [("tmpdir", "/tmp")],

  • parameter allow_anonymous

    tell whether clients using anonymous authentication will be accepted. It defaults to false,

  • parameter f

    is the callback which receive new clients. It takes as arguments the server and the connection for the client.

About errors:

  • if no addresses are provided, it raises Invalid_argument,
  • if an address is invalid, it raises Invalid_argument
  • if listening fails for one of the addresses, it fails with the exception reported for that address

It succeeds if it can listen on at least one address.

When a new client connects, the server handles authentication of this client, then it creates a transport and the connection on top of this transport.

Note that connections passed to f are initially down. It is up to the user to set them up with OBus_connection.set_up.

Sourceval make_lowlevel : ?switch:Lwt_switch.t -> ?capabilities:OBus_auth.capability list -> ?mechanisms:OBus_auth.Server.mechanism list -> ?addresses:OBus_address.t list -> ?allow_anonymous:bool -> (t -> OBus_transport.t -> unit) -> t Lwt.t

make_lowlevel is the same as make except that f receives only the transport, and no connection is created for this transport.

OCaml

Innovation. Community. Security.