Warning
xrpc is an early development project.
A small (but very fun) project to explore RPC in C.
The target of xrpc is to produce a libxrpc that users can use in their own projects allowing
to choose different transport implementations: from raw TCP sockets to RDMA.
Protocol description can be found at PROTOCOL.md.
The goal of the library is to provide a minimal API to integrate RPC functionalities into an existing project. Build the library:
makeThe build process outputs libxrpc.a in the root directory of the project.
Link it in your projects and copy include/ for API declaration.
cp -r include/ /path/to/project/include/
cp libxrpc.a /path/to/project/libFor examples, refer to the examples folder.
Execute all the available tests in test/ using:
make test-runIf you have Valgrind installed and in your $PATH you can run the tests with:
make test-run-valgrindYou can build and run tests and library with sanitizers using make SANITIZE=1 ....
If your platform does not support sanitizers (ie. you use musl), you can use the
Dockerfile to build an image with glibc.
docker build -t xrpc-sanitizers .
docker run --rm -v $(pwd):/workspace -w /workspace xrpc-build sh -c "make SANITIZE=1 clean test-run && make clean test-run-valgrind"To get a working LSP, you can use Bear to generate a compile_commands.json.
bear -- make