Giter VIP home page Giter VIP logo

flatbuffers-zmq-tutorial-cpp's Introduction

FlatBuffers and ZeroMQ Sample in C++

First part, detailed description and implementation in Go.

Build

The following code generates C++ header file from FlatBuffers schema and builds executables in bin folder:

mkdir build
cd build
cmake ..
make

Run

First, we run the router, which is a receiver:

./bin/reader

It listens on tcp://*:5555".

Secondly run the dealer, which sends data to the router:

./bin/writer

You should now see the received data in the router STDOUT:

Received request for Median on axis 0
Description: do any calc
Number of values: 

Alternatively you can run applications from Go implementation. They are based on the same FlatBuffers schema and are interchangeable.

C++ is a router, Go is a dealer:

./bin/reader
go run $GOPATH/src/github.com/igorskh/flatbuffers-zmq-tutorial/writer/main.go

Output:

Received request for Average on axis 0
Description: do something
Number of values: 5 

Go is a router, C++ is a dealer:

go run $GOPATH/src/github.com/igorskh/flatbuffers-zmq-tutorial/reader/main.go
./bin/writer

Output:

2020/02/12 12:24:14 router created and bound
2020/02/12 12:24:15 router received from '[0 60 125 57 156]'
Got request:  do any calc
Calc axis:  0
Values:  5
[0 1 2 3 4]
Calculating Median
Result:  1.5

flatbuffers-zmq-tutorial-cpp's People

Contributors

igorskh avatar

Watchers

 avatar

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.