module OBus_transport:sig
..end
type
t
val recv : t -> OBus_message.t Lwt.t
recv tr
receives one message from the given transportval send : t -> OBus_message.t -> unit Lwt.t
send tr msg
sends msg
over the transport tr
.val capabilities : t -> OBus_auth.capability list
val shutdown : t -> unit Lwt.t
shutdown tr
free resources allocated by the given transportval make : ?switch:Lwt_switch.t ->
recv:(unit -> OBus_message.t Lwt.t) ->
send:(OBus_message.t -> unit Lwt.t) ->
?capabilities:OBus_auth.capability list ->
shutdown:(unit -> unit Lwt.t) -> unit -> t
make ?switch ~recv ~send ~support_unxi_fd ~shutdown ()
creates
a new transport from the given functions.capabilities
: defaults to []
.
Notes:
val loopback : unit -> t
val socket : ?switch:Lwt_switch.t ->
?capabilities:OBus_auth.capability list ->
Lwt_unix.file_descr -> t
socket ?switch ?capabilities socket
creates a socket
transport.capabilities
: defaults to []
. For unix socket, the
`Unix_fd
capability is accepted.val of_addresses : ?switch:Lwt_switch.t ->
?capabilities:OBus_auth.capability list ->
?mechanisms:OBus_auth.Client.mechanism list ->
OBus_address.t list -> (OBus_address.guid * t) Lwt.t
of_addresses ?switch ?capabilities ?mechanisms addresses
tries to:
mechanisms
, which
defaults to OBus_auth.Client.default_mechanisms
,capabilities
, which defaults to
OBus_auth.capabilities
Note about errors:
addresses = []
,
it raises Invalid_argument
,Failure
or
a Unix.Unix_error
OBus_auth.Auth_error
is
raised