canonical libwebsockets.org websocket library
Find a file
Andy Green f32d25051c ws ping pong on idle connections
This adds a new member to the context creation info struct "ws_ping_pong_interval".

If nonzero, it sets the number of seconds that established ws connections are
allowed to be idle before a PING is forced to be sent.  If zero (the default) then
tracking of idle connection is disabled for backwards compatibility.

Timeouts cover both the period between decision to send the ping and it being
sent (because it needs the socket to become writeable), and the period between
the ping being sent and the PONG coming back.

INFO debug logs are issues when the timeout stuff is operating.

You can test the server side by running the test server hacked to set ws_ping_pong_interval
and debug log mask of 15.  Both the mirror protocol and the server-status protocol are
idle if nothing is happening and will trigger the PING / PONG testing.  (You can also
test using lwsws and /etc/lwsws/conf with "ws-pingpong-secs": "20" in the global section)

For client, run the test client with -n -P 20 for 20s interval.  -n stops the test client
writing using the mirror protocol, so it will be idle and trigger the PING / PONGs.

The timeout interval may be up to +10s late, as lws checks for affected connections every
10s.
2016-08-10 21:20:23 +08:00
cmake add missing CMake pieces 2014-02-16 01:52:50 +08:00
contrib android make script contrib 2016-04-23 18:28:03 +08:00
doc ws ping pong on idle connections 2016-08-10 21:20:23 +08:00
doc-assets plugin table dirlisting 2016-07-14 08:57:28 +08:00
lib ws ping pong on idle connections 2016-08-10 21:20:23 +08:00
lwsws ws ping pong on idle connections 2016-08-10 21:20:23 +08:00
plugin-standalone plugins add win modifiers before libwebsockets.h for dll export flag 2016-05-26 07:52:20 +08:00
plugins Plugin server-status cleanup 2016-08-10 21:20:23 +08:00
scripts documentation convert to doxygen 2016-07-14 08:57:27 +08:00
test-server ws ping pong on idle connections 2016-08-10 21:20:23 +08:00
win32port documentation convert to doxygen 2016-07-14 08:57:27 +08:00
.gitignore Ignore cmake build/ directory 2015-10-16 21:07:38 +02:00
.travis.yml plugins 2016-04-07 09:38:08 +08:00
Android.mk android include gregorys example makefile 2013-03-10 07:34:53 +08:00
appveyor.yml protocol generic sessions 2016-06-18 06:44:31 +08:00
autobahn-test.sh autobahn wait for all fork completion 2016-02-15 14:57:55 +08:00
changelog add lws_init_vhost_client_ssl api to allow client ssl use on a vhost 2016-05-12 21:14:13 +08:00
CMakeLists.txt plugin table dirlisting 2016-07-14 08:57:28 +08:00
cross-arm-linux-gnueabihf.cmake cmake improve cross documentation 2013-03-30 10:30:03 +08:00
cross-ming.cmake Trac 53 minw update 2013-12-18 10:17:25 +08:00
cross-openwrt-makefile Allow using CyaSSL in stead of wolfSSL 2015-10-12 08:17:55 +08:00
FindLibWebSockets.cmake add cmake Find for lws 2015-10-13 08:20:41 +08:00
libwebsockets.dox plugin table dirlisting 2016-07-14 08:57:28 +08:00
libwebsockets.spec v2.0.0 2016-05-05 09:40:18 +08:00
LICENSE lwsws Libwebsockets Web Server 2016-03-28 10:49:57 +08:00
lws_config.h.in lejp-conf: substitute _lws_ddir_ with install dir 2016-07-14 08:57:28 +08:00
lws_config_private.h.in server status add getloadavg and lib version and more css 2016-04-26 14:54:09 +08:00
mainpage.md documentation convert to doxygen 2016-07-14 08:57:27 +08:00
module.json mbed simplify 2016-01-26 20:45:10 +08:00
README.build.md doxygen use sections 2016-07-14 08:57:28 +08:00
README.coding.md plugins-dim-webpage-when-connection-lost 2016-07-14 08:57:28 +08:00
README.generic-sessions.md doxygen use sections 2016-07-14 08:57:28 +08:00
README.generic-table.md plugin table dirlisting 2016-07-14 08:57:28 +08:00
README.lwsws.md ws ping pong on idle connections 2016-08-10 21:20:23 +08:00
README.md documentation convert to doxygen 2016-07-14 08:57:27 +08:00
README.problems.md plugin table dirlisting 2016-07-14 08:57:28 +08:00
README.test-apps.md doxygen use sections 2016-07-14 08:57:28 +08:00
release-checklist update api docs v2.0 2016-05-07 14:24:36 +08:00
travis_install.sh plugins 2016-04-07 09:38:08 +08:00

Travis Build Status Appveyor Build status Coverity Scan Build Status

libwebsockets

This is the libwebsockets C library for lightweight websocket clients and servers. For support, visit

https://libwebsockets.org https://github.com/warmcat/libwebsockets

and consider joining the project mailing list at

https://libwebsockets.org/mailman/listinfo/libwebsockets

| News |

| We have updated https://libwebsockets.org, if you would like your project using lws featured in the image carousel, send an image, project URL and brief summary to andy@warmcat.com |

You can get the latest version of the library from git:

Doxygen API docs for master: https://libwebsockets.org/lws-api-doc-master/html/index.html

After libwebsockets 1.3, tags will be signed using a key corresponding to this public key

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQINBFRe35QBEADZA7snW7MoEXkT2deDYZeggVD3694dg1o5G4q36NWjC8Pn/b2V
d+L9Nmw8ydKIv8PLJW762rnveQpPYRqCRD8X4bVTYzYz3qsOl5BrYf6cuVn0ZrPB
13TVRg+NZwUaVxc7O+tdOvvEBdA9OCIygctPNK9Nyh53xs5gPHhghZrKVrt0xM1A
2LYsgoHmMBCCY25SHb1nuapvhA3LvuJb4cNNVRCukCoA6yx0uhSEz2AUPJSLqnZ9
XnNBMKq+1a9C+y7jo4O78upTTmuOmRmNEVAu7pxCSUXDrNa87T8n6vFkV/MiW8nv
VmhppKJrKPJ0KxJF9b7uG6eKosfoK2PKyE7pAoDN1fuNyBTB0dkFAwyTCN8hmhOg
z71QrCltotq/AxSCsKzgFkDBL7D3KUM10QR5kmznjcm8tFWHoSttPR334z/1Yepf
ATqH/tfYydW42qeeHgKjfeegnlI65nTDtwYW6lSqZsXg+/ABg0ki9m5HA6l713ig
gRbVHSNkiz56O+UOqBtfcJZBc8QZqqixq8rbP2Is0HBBEtD+aFMuKx/sQ3ULkQs2
8dZ5qsGTBT/xHmqpHJsIFX/jwjY5zeEiFbnO5bMH7YLmkjynVsn5zxTyXKQJe29C
Uq0Yd9+JpDhHnZoiz/1hIIBsr89Z4Yy6c59YNJ3yJEOast0ODERcKSaUAQARAQAB
tC9BbmR5IEdyZWVuIChMaW5hcm8ga2V5KSA8YW5keS5ncmVlbkBsaW5hcm8ub3Jn
PokCPQQTAQoAJwUCVF7flAIbAwUJBaOagAULCQgHAwUVCgkICwUWAwIBAAIeAQIX
gAAKCRA8ZxoDS3lTexApD/9WT7JWy3tK33OIACYV40XwLEhRam4Xku4rhtsoIeJK
P0k/wa7J2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