This library implements a simple network communication pattern. On the server-side, we implement a simple class with a publish socket for streaming and a request-reply control-socket for synchronous control messages. On the client-side we provide a simple class to subscribe to the published stream as well as issue synchronous requests to the control socket.
The backend is based on Simple-Websocket-Server.
Dependencies:
- Boost
- OpenSSL
Build with cmake.
$ git submodule update --init --recursive # Do this once
$ mkdir build && cd build
$ cmake -D BOOT_ROOT=/path/to/boost .. # BOOST_ROOT not necessary if installed to default location
$ cmake --build .
(see below for how to build examples/tests)
or, add this as a submodule or take a snapshot of the repository and in your CMakeLists.txt, add:
add_subdirectory(path/to/wspubctrl wspubctrl)
add_executable(myapp main.cpp)
target_link_libraries(myapp wspubctrl)
- OpenSSL: Install openssl to the default location. Installer here. I use Win64 OpenSSL v1.1.0h.
- Boost: See boost.org
$ mkdir build && cd build
$ cmake -G "Visual Studio 14 2015 Win64" -D BOOST_ROOT='C:\path\to\boost' -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON ..
$ cmake --build .
See examples
directory.
To build the examples and tests run:
$ mkdir -p build && cd build
$ cmake -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON ..
$ make