OBus_serverSourceServers 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.tmake ?switch ?capabilities ?mechanisms ?addresses ?allow_anonymous f Creates a server which will listen on all of the given addresses.
About errors:
Invalid_argument,Invalid_argumentIt 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.tmake_lowlevel is the same as make except that f receives only the transport, and no connection is created for this transport.