diff options
author | Daniil Baturin <daniil@baturin.org> | 2017-01-15 23:07:39 +0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2017-01-15 23:07:39 +0700 |
commit | 291a998ca375077b3c23c1e3c43a7fc206c8de4b (patch) | |
tree | f107bee0f33a747f9375a0a76932ac38b69f29c7 /src/message.mli | |
parent | fa6a9c8b5d8d127bbce810aa14d4468de437469f (diff) | |
download | vyconf-291a998ca375077b3c23c1e3c43a7fc206c8de4b.tar.gz vyconf-291a998ca375077b3c23c1e3c43a7fc206c8de4b.zip |
Add functionality for socket communication.
The Message module contains read and write functions that take care of
the wire protocol, which sends a 4 byte length header before every message.
They take a bytes buffer and don't care about its contents.
The Vyconf_client module has high level functions for interfacing with vyconfd.
Functions for creating a socket and creating a server loop are in Startup.
The rest is, for now at least, right in vyconfd.
Notes:
Message.read/write probably should be wrapped in Lwt_io.atomic
We need to find out if it's safe to reuse Pbrt.Encoder.t or we really
should create it every time.
Diffstat (limited to 'src/message.mli')
-rw-r--r-- | src/message.mli | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/message.mli b/src/message.mli new file mode 100644 index 0000000..ec44c56 --- /dev/null +++ b/src/message.mli @@ -0,0 +1,3 @@ +val read : Lwt_io.input_channel -> bytes Lwt.t + +val write : Lwt_io.output_channel -> bytes -> unit Lwt.t |