Easy inter-process communication for Windows and GNU/Linux!
NinjaIPC is your go-to library for straightforward, efficient inter-process communication. Itβs designed to make IPC as simple as possible, without sacrificing performance. With a small footprint and an easy-to-understand blocking API, NinjaIPC enables you to focus on your application, not the plumbing.
Platform | Support |
---|---|
Windows | β Supported |
Linux | β Supported |
macOS | β Supported |
Language | Status |
---|---|
C++ | β Officialy supported |
Java | π Coming Soon |
Node.js | π Coming Soon |
The NinjaIPC library also provides a C++ API that makes it even easier to perform inter-process communication.
Below is a simple example demonstrating how to use the Channel
class, to communicate a simple int32 back and forth.
/* Server */
#include <ninjaipc.h>
using namespace NinjaIPC;
int main() {
auto channel = Channel::make("Readme", sizeof(int));
while (true) {
auto i = channel->receive<int>();
int r = 321;
channel->reply(r);
std::cout << "Received " << i << " sent " << r << '\n';
}
}
/* Client */
#include <ninjaipc.h>
using namespace NinjaIPC;
int main() {
auto channel = Channel::connect("Readme", sizeof(int));
while (true) {
int i = 123;
int r = channel->send(i);
std::cout << "Sent " << i << " Received " << r << '\n';
}
}
Running server then client, will produce this output:
Received 123 sent 321
Received 123 sent 321
Received 123 sent 321
...
Sent 123 Received 321
Sent 123 Received 321
Sent 123 Received 321
...
The source code is licensed under the Apache License 2.0.