tree: 3cf9b10a30dc8418d405d0ebdb7e6b38150d0656 [path history] [tgz]
  1. mount-origin/
  2. CMakeLists.txt
  3. minimal-ws-server-ring.c
  4. protocol_lws_minimal.c
  5. README.md
minimal-examples/ws-server/minimal-ws-server-ring/README.md

lws minimal ws server (lws_ring)

build

 $ cmake . && make

usage

 $ ./lws-minimal-ws-server
[2018/03/04 09:30:02:7986] USER: LWS minimal ws server (lws_ring) | visit http://localhost:7681
[2018/03/04 09:30:02:7986] NOTICE: Creating Vhost 'default' port 7681, 1 protocols, IPv6 on

Visit http://localhost:7681 on multiple browser windows

Text you type in any browser window is sent to all of them.

A ringbuffer holds up to 8 lines of text.

This also demonstrates how the ringbuffer can take action against lagging or disconnected clients that cause the ringbuffer to fill.