Simple asynchronous networking in ocaml.
Switch branches/tags
Nothing to show
Clone or download


Sonet is a collection of modules for asynchronous network
applications.  It is intended as a simpler alternative to the use of
the impressive ocamlnet package(s).

The modules contain an eventloop implementation, and parsers for some
common protocols.

The eventloop module is based on epoll for Linux, and defaults to
OCaml's on other platforms.  It should be straightforward
to bind to alternatives like kqueue on other platforms.

Parsers and connection implementations exist for the HTTP/1.1 and
D-Bus protocols.  Parsers also exist for the JSON, JSONRPC and Bencode

Two code-generators are provided to ease the use of JSON and JSONRPC.
One (json_convert) generates code to convert between OCaml native
types and JSON.  Another (gen_rpc) generates code for the client and
server portions of a JSONRPC server, using an IDL description for the
messages in the RPC protocol.


OCaml 3.12+


Sonet can be built using ocamlbuild (via make) or OMake.  The build
using ocamlbuild does not currently build the JSON code-generators;
the build using OMake is comprehensive.


Installation currently uses the ocamlbuild build and depends on

$ make && make install


From source directory:

$ make uninstall


$ ocamlfind remove sonet

For system-wide OCaml installations, the install and uninstall
commands above will have to be run as root.