Coder Social home page Coder Social logo

pbrpcpp's Introduction

pbRPCpp

pbRPCpp is a small C++ RPC library built on top of boost::asio and google's protocol buffer, sponsored by Springbeats, and released under Boost License.

Goals

PbRPCpp aims to provide a simple Remote Procedure Call API for C++ programs. It was initially built to simplify client/server communications in desktop applications that were already using protobuf as a payload format.

Because it is built on top of Boost, it is quite portable.

Getting Started

Dependencies

Note that the license for all these components allow a commercial usage (please have a look at them for details).

Building

Build system relies on Premake4, which generates project files for you, depending on the target you choose (gmake, xcode3, xcode4, vs2008, etc. Type premake4 --help to see all the available targets).

For example using gmake:

cd build
premake4 --gtestdir=../../protobuf/gtest --boostdir=../../boost --protobufdir=../../protobuf gmake
make config=debug64

This will build the static lib and unit-tests in the bin/ directory.

Defining your service in protobuf

// File: echo.proto
package echo;
option cc_generic_services = true;

message EchoRequest
{
  required string message = 1;
}

message EchoResponse
{
  required string response = 1;
}

service EchoService
{
  rpc Echo(EchoRequest) returns (EchoResponse);
}

Compilation with protoc --cpp_out=. echo.proto generates echo.pb.h/echo.pb.cc files.

Using your service in Server code

TODO

Using your service in Client code

TODO

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.