All Projects → cinemast → Libjson Rpc Cpp

cinemast / Libjson Rpc Cpp

Licence: mit
C++ framework for json-rpc (json remote procedure call)

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Libjson Rpc Cpp

Co
Art of C++. Flag, logging, unit-test, json, go-style coroutine and more.
Stars: ✭ 2,264 (+246.71%)
Mutual labels:  rpc, json-rpc, json
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (-18.53%)
Mutual labels:  rpc, json-rpc, json
Jsonrpc
The jsonrpc package helps implement of JSON-RPC 2.0
Stars: ✭ 143 (-78.1%)
Mutual labels:  rpc, json-rpc, json
coreipc
WCF-like service model API for communication over named pipes and TCP. .NET and node.js clients.
Stars: ✭ 22 (-96.63%)
Mutual labels:  json-rpc, rpc
xmlrpcwsc-dotnet
XML-RPC Web Service Client C# implementation
Stars: ✭ 30 (-95.41%)
Mutual labels:  json-rpc, rpc
Ether1
Official Go implementation of The Etho Protocol
Stars: ✭ 41 (-93.72%)
Mutual labels:  json-rpc, rpc
jsonrpcpp
C++ JSON-RPC 2.0 library
Stars: ✭ 97 (-85.15%)
Mutual labels:  json-rpc, rpc
JsonRpc.Standard
An asynchronous .NET Standard library for JSON RPC client & server implementation.
Stars: ✭ 27 (-95.87%)
Mutual labels:  json-rpc, rpc
scala-json-rpc
Let your servers and clients communicate over function calls! JSON-RPC 2.0 library for Scala and Scala.js
Stars: ✭ 38 (-94.18%)
Mutual labels:  json-rpc, rpc
Bebop
An extremely simple, fast, efficient, cross-platform serialization format
Stars: ✭ 305 (-53.29%)
Mutual labels:  rpc, json
Joyrpc
high-performance, high-extensibility Java rpc framework.
Stars: ✭ 290 (-55.59%)
Mutual labels:  rpc, json-rpc
Webrpc
webrpc is a schema-driven approach to writing backend services for modern Web apps and networks
Stars: ✭ 342 (-47.63%)
Mutual labels:  rpc, json
Ethereumjs Abi
[DEPRECATED] Decoder and encoder for the Ethereum ABI
Stars: ✭ 235 (-64.01%)
Mutual labels:  rpc, json
Rpc
Simple RPC style APIs with generated clients & servers.
Stars: ✭ 192 (-70.6%)
Mutual labels:  rpc, json-rpc
Spooky
An HttpClient based Json RPC 2.0/XML-RPC client for .Net.
Stars: ✭ 16 (-97.55%)
Mutual labels:  json-rpc, rpc
Dop
JavaScript implementation for Distributed Object Protocol
Stars: ✭ 163 (-75.04%)
Mutual labels:  rpc, json
server
Implement the JSON-RPC 2.0 server specification for @laravel.
Stars: ✭ 154 (-76.42%)
Mutual labels:  json-rpc, rpc
Ti Rpc
基于swoole封装的一个简易的JSON协议的RPC框架,思路是借鉴的,代码是自己写的。小修小改的,目前服务于前公司(注意是前公司)生产环境,每日支撑大约8000万次调用。
Stars: ✭ 144 (-77.95%)
Mutual labels:  rpc, json
aiohttp-rpc
A simple JSON-RPC for aiohttp
Stars: ✭ 22 (-96.63%)
Mutual labels:  json-rpc, rpc
Vs Streamjsonrpc
The StreamJsonRpc library offers JSON-RPC 2.0 over any .NET Stream, WebSocket, or Pipe. With bonus support for request cancellation, client proxy generation, and more.
Stars: ✭ 421 (-35.53%)
Mutual labels:  rpc, json-rpc

I am currently working on a new C++17 implementation -> json-rpc-cxx.

Master Build Status codecov Develop Build Status codecov | Coverity Status

libjson-rpc-cpp

This framework provides cross platform JSON-RPC (remote procedure call) support for C++. It is fully JSON-RPC 2.0 & 1.0 compatible.

libjson-rpc-cpp logo

5 good reasons for using libjson-rpc-cpp in your next RPC project

  • Full JSON-RPC 2.0 & partial JSON-RPC 1.0 client and server Support.
  • jsonrpcstub - a tool that generates stub-classes for your JSON-RPC client and server applications.
  • Ready to use HTTP + TCP server and client to provide simple interfaces for your JSON-RPC application.
  • Cross platform build support for Linux and OS X.
  • Super liberal MIT-License.

Other good reasons to use libjson-rpc-cpp

  • Easy to use cmake cross platform build system.
  • Clean and simple architecture, which makes it easy to extend.
  • Continuously tested under MacOS, and various linux distributions.
  • Automated testing using make test.
  • Useful Examples provided. e.g. XBMC Remote using json-rpc client part and stub generator.
  • The stubgenerator currently supports C++, JavaScript, and Python.

Overview

libjson-rpc-cpp logo

Install the framework

Debian (stretch) and Ubuntu (15.10 or later)

sudo apt-get install libjsonrpccpp-dev libjsonrpccpp-tools

Fedora

sudo dnf install libjson-rpc-cpp-devel libjson-rpc-cpp-tools

Arch Linux

For Arch Linux there is a PKGBUILD provided in the AUR.

sudo aura -A libjson-rpc-cpp

Gentoo Linux

sudo emerge dev-cpp/libjson-rpc-cpp

Mac OS X

For OS X a Brew package is available:

brew install libjson-rpc-cpp

Windows

There is a ready to use compiled package here. Just download execute the installer EXE.

Build from source

Install the dependencies

UNIX

For Debian and Arch GNU/Linux based systems, all dependencies are available via the package manager. For OS X all dependencies are available in Brew

Build

git clone git://github.com/cinemast/libjson-rpc-cpp.git
mkdir -p libjson-rpc-cpp/build
cd libjson-rpc-cpp/build
cmake .. && make
sudo make install
sudo ldconfig          #only required for linux

That's it!

If you are not happy with it, simply uninstall it from your system using (inside the build the directory):

sudo make uninstall

Build options:

Default configuration should be fine for most systems, but here are available compilation flags:

  • -DCOMPILE_TESTS=NO disables unit test suite.
  • -DCOMPILE_STUBGEN=NO disables building the stubgenerator.
  • -DCOMPILE_EXAMPLES=NO disables examples.
  • -DHTTP_SERVER=NO disable the libmicrohttpd webserver.
  • -DHTTP_CLIENT=NO disable the curl client.
  • -DREDIS_SERVER=NO disable the redis server connector.
  • -DREDIS_CLIENT=NO disable the redis client connector.
  • -DUNIX_DOMAIN_SOCKET_SERVER=YES enable the unix domain socket server connector.
  • -DUNIX_DOMAIN_SOCKET_CLIENT=YES enable the unix domain socket client connector.
  • -DFILE_DESCRIPTOR_SERVER=NO disable the file descriptor server connector.
  • -DFILE_DESCRIPTOR_CLIENT=NO disable the file descriptor client connector.
  • -DTCP_SOCKET_SERVER=NO disable the tcp socket server connector.
  • -DTCP_SOCKET_CLIENT=NO disable the tcp socket client connector.

Using the framework

This example will show the most simple way to create a rpc server and client. If you only need the server, ignore step 4. If you only need the client, ignore step 3. You can find all resources of this sample in the src/examples directory of this repository.

Step 1: Writing the specification file

[
	{
		"name": "sayHello",
		"params": {
			"name": "Peter"
		},
		"returns" : "Hello Peter"
	},
	{
		"name" : "notifyServer"
	}
]

The type of a return value or parameter is defined by the literal assigned to it. The generated stubs will will use the "returns" type to validate the response. In this example you can see how to specify methods and notifications.

Step 2: Generate the stubs for client and server

Call jsonrpcstub:

jsonrpcstub spec.json --cpp-server=AbstractStubServer --cpp-client=StubClient
mkdir -p gen
mv abstractstubserver.h gen
mv stubclient.ch gen

This generates an AbstractStubServer and a StubClient class and moves them to the gen folder.

Step 3: implement the abstract server stub

Extend the abstract server stub and implement all pure virtual (abstract) methods defined in spec.json.

See src/examples/stubserver.cpp

In the main function the concrete server is instantiated and started. That is all for the server. Any JSON-RPC 2.0 compliant client can now connect to your server.

Compile the server with:

g++ stubserver.cpp -ljsoncpp -lmicrohttpd -ljsonrpccpp-common -ljsonrpccpp-server -o sampleserver

Step 4: Create the client application

See src/examples/stubclient.cpp

Compile the client with:

g++ stubclient.cpp -ljsoncpp -lcurl -ljsonrpccpp-common -ljsonrpccpp-client -o sampleclient

Contributions

Please take a look at CONTRIBUTING.md

You can also donate via Donate

Changelogs

Changelogs can be found here.

API compatibility

We do our best to keep the API/ABI stable, to prevent problems when updating this framework. A compatiblity report can be found here.

License

This framework is licensed under MIT. All of this libraries dependencies are licensed under MIT compatible licenses.

References

If you use this library and find it useful, I would be very pleased if you let me know about it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].