package obus
Install
Dune Dependency
Authors
Maintainers
Sources
md5=81eb1034c6ef4421a2368a9b352199de
sha512=4b540497188a7d78f4f14f94c6b7fdff47dd06436a34e650ff378dd77bb3e2acb7afd45cd72daf4ddba06e732e9944d560c2882dc37862f1b1f1bb6df37e6205
doc/obus/OBus_server/index.html
Module OBus_server
Source
Servers for one-to-one communication
Type of a server
addresses server
returns all the addresses the server is listenning on. These addresses must be passed to clients so they can connect to server
.
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.
val 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.
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
.
val 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.