mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
![]() Establish a new distributed CMake architecture with CMake code related to a source directory moving to be in the subdir in its own CMakeLists.txt. In particular, there's now one in ./lib which calls through to ones further down the directory tree like ./lib/plat/xxx, ./lib/roles/xxx etc. This cuts the main CMakelists.txt from 98KB -> 33KB, about a 66% reduction, and it's much easier to maintain sub-CMakeLists.txt that are in the same directory as the sources they manage, and conceal all the details that that level. Child CMakelists.txt become responsible for: - include_directories() definition (this is not supported by CMake directly, it passes it back up via PARENT_SCOPE vars in helper macros) - Addition child CMakeLists.txt inclusion, for example toplevel -> role -> role subdir - Source file addition to the build - Dependent library path resolution... this is now a private thing in the child CMakeLists.txt, it just passes back any adaptations to include_directories() and the LIB_LIST without filling the parent namespace with the details |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
libwebsockets.org.cer | ||
minimal-ws-client-spam.c | ||
README.md |
lws minimal ws client SPAM
This connects to libwebsockets.org using the lws-mirror-protocol.
By default is has 10 concurrent connections and connects 100 times.
build
$ cmake . && make
Commandline Options
Option | Meaning |
---|---|
-d | Set logging verbosity |
--server | Use a specific server instead of libwebsockets.org, eg --server localhost . Implies LCCSCF_ALLOW_SELFSIGNED |
--port | Use a specific port instead of 443, eg --port 7681 |
-c | Amount of concurrent connections |
-l | Test limit (total number of connections to make) |
usage
Just run it, it will repeatedly connect and reconnect to libwebsockets.org until it hits the test limit.
You can also direct it to use the lws test server in tls mode by running that
with libwebsockets-test-server -s
and running this using, eg
$ ./lws-minimal-ws-client-spam -c 20 -l 200 --server localhost --port 7681
$ ./lws-minimal-ws-client-spam
[2018/11/15 09:53:19:9639] USER: LWS minimal ws client SPAM
[2018/11/15 09:53:19:9647] NOTICE: Creating Vhost 'default' (serving disabled), 1 protocols, IPv6 off
[2018/11/15 09:53:19:9695] NOTICE: created client ssl context for default
[2018/11/15 09:53:21:0976] USER: callback_minimal_spam: established (try 10, est 0, closed 0, err 0)
[2018/11/15 09:53:21:1041] USER: callback_minimal_spam: established (try 10, est 1, closed 0, err 0)
[2018/11/15 09:53:21:1089] USER: callback_minimal_spam: established (try 10, est 2, closed 0, err 0)
[2018/11/15 09:53:21:1132] USER: callback_minimal_spam: established (try 10, est 3, closed 0, err 0)
[2018/11/15 09:53:21:1166] USER: callback_minimal_spam: established (try 10, est 4, closed 0, err 0)
[2018/11/15 09:53:21:1531] USER: callback_minimal_spam: established (try 10, est 5, closed 0, err 0)
[2018/11/15 09:53:21:1563] USER: callback_minimal_spam: established (try 10, est 6, closed 0, err 0)
[2018/11/15 09:53:21:1589] USER: callback_minimal_spam: established (try 10, est 7, closed 0, err 0)
[2018/11/15 09:53:21:1616] USER: callback_minimal_spam: established (try 10, est 8, closed 0, err 0)
[2018/11/15 09:53:21:1671] USER: callback_minimal_spam: established (try 10, est 9, closed 0, err 0)
[2018/11/15 09:53:21:3778] USER: callback_minimal_spam: reopening (try 11, est 10, closed 1, err 0)
...