Skip to content

jmuncaster/wspubctrl

Repository files navigation

Websockets Publisher with Control Socket

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.

Getting Started

Build

Dependencies:

  • Boost
  • OpenSSL

Linux

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)

Windows

$ 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 .

Examples

See examples directory.

Build Examples and Tests

To build the examples and tests run:

$ mkdir -p build && cd build
$ cmake -D BUILD_EXAMPLES=ON -D BUILD_TESTS=ON ..
$ make

About

Pub/sub with control socket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published