Examples

The Autobahn|Cpp repository contains a number of examples that demonstrate all 4 basic patterns of using WAMP:

Building the Examples

For building the examples, add the following to your ~/.profile:

## Use clang
##
export CC='clang'
export CXX='clang++'

## Libaries (clang based)
##
export BOOST_ROOT=${HOME}/boost_trunk_clang
export LD_LIBRARY_PATH=${BOOST_ROOT}/stage/lib:${LD_LIBRARY_PATH}

export MSGPACK_ROOT=${HOME}/msgpack_clang
export LD_LIBRARY_PATH=${MSGPACK_ROOT}/lib:${LD_LIBRARY_PATH}

For building with GCC, use the following

## Use GNU
##
export CC='gcc'
export CXX='g++'

## Libraries (GCC based)
##
export BOOST_ROOT=${HOME}/boost_trunk_gcc
export LD_LIBRARY_PATH=${BOOST_ROOT}/stage/lib:${LD_LIBRARY_PATH}

export MSGPACK_ROOT=${HOME}/msgpack_gcc
export LD_LIBRARY_PATH=${MSGPACK_ROOT}/lib:${LD_LIBRARY_PATH}

Now build all examples:

cd autobahn/examples
scons -j 4

The examples will get built in autobahn/build/examples.

Running the Examples

The examples include a Autobahn|Python based WAMP router and example backend.

To run this, you need Python and pip already installed.

Then, to install Autobahn|Python

pip install autobahn[twisted]

Start the example router in a first terminal

cd autobahn/examples
python server.py

Then start one of the built C++ examples in a second terminal

cd autobahn
./build/examples/call1
Reactive Manifesto: We are reactive banner