package obus
Module OBus_wireSource
Message serialization/deserialization
Exception raised when a message can not be sent. The parameter is an error message.
Possible reasons are: the message is too big or contains arrays that are too big.
Exception raised when a received message is not valid.
Possible reasons are:
- a size limit is exceeded
- a name/string/object-path is not valid
- a boolean value is other than 0 or 1
- ...
read_message ic deserializes a message from a channel. It fails if the message contains file descriptors.
val write_message :
Lwt_io.output_channel ->
?byte_order:Lwt_io.byte_order ->
OBus_message.t ->
unit Lwt.twrite_message oc ?byte_order message serializes a message to a channel. It fails if the message contains file descriptors.
message_of_string buf fds returns a message from a string. fds is used to resolv file descriptors the message may contains.
val string_of_message :
?byte_order:Lwt_io.byte_order ->
OBus_message.t ->
string * Unix.file_descr arrayMarshal a message into a string. Returns also the list of file descriptors that must be sent with the message.
A reader which support unix fd passing
reader unix_socket creates a reader from a unix socket
Read a message with its file descriptors from the given reader
close_reader reader closes the given reader.
Note: this does not close the underlying file descriptor.
A writer which support unix fd passing
writer unix_socket creates a writer from a unix socket
val write_message_with_fds :
writer ->
?byte_order:Lwt_io.byte_order ->
OBus_message.t ->
unit Lwt.tWrite a message with its file descriptors on the given writer