1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00
libwebsockets/test-server
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
..
android Android: update to use SDK Python script 2016-06-07 02:42:32 +08:00
.gitignore Ignoring linux build files 2013-01-09 15:46:11 +08:00
attack.sh fix %3d handling in path part and add attack.sh 2016-05-07 08:31:33 +08:00
favicon.ico refactor-into-dirs.patch 2010-11-01 09:12:17 +00:00
fuzxy.c Don't include <sys/cdefs.h> for NetBSD 2016-02-27 10:30:59 +08:00
leaf.jpg add by hand http send example 2013-02-14 23:24:07 +08:00
libwebsockets-test-server.service test server example systemd service file 2016-02-19 12:46:36 +08:00
libwebsockets.org-logo.png add libwebsockets.org logo to share 2013-01-16 10:00:39 +08:00
lws-cgi-test.sh cgi post 2016-04-13 11:53:40 +08:00
lws-common.js plugin table dirlisting 2016-07-14 08:57:28 +08:00
test-client.c ws ping pong on idle connections 2016-08-10 21:20:23 +08:00
test-echo.c LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT to default to runtime ssl disable 2016-03-23 09:22:11 +08:00
test-fraggle.c LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT to default to runtime ssl disable 2016-03-23 09:22:11 +08:00
test-ping.c LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT to default to runtime ssl disable 2016-03-23 09:22:11 +08:00
test-server-dumb-increment.c license clarification and test apps CC zero 2016-02-08 08:44:21 +08:00
test-server-echogen.c license clarification and test apps CC zero 2016-02-08 08:44:21 +08:00
test-server-http.c plugins-dim-webpage-when-connection-lost 2016-07-14 08:57:28 +08:00
test-server-libev.c test-libev add server-status protocol 2016-07-14 08:57:27 +08:00
test-server-libuv.c libuv fixes for foreign loop test 2016-05-04 08:40:46 +08:00
test-server-mirror.c license clarification and test apps CC zero 2016-02-08 08:44:21 +08:00
test-server-pthreads.c polarssl implementation 2016-04-18 20:05:43 +08:00
test-server-status.c win32 needs strange strftime args 2016-04-05 19:15:34 +08:00
test-server-v2.0.c protocol generic sessions 2016-06-18 06:44:31 +08:00
test-server.c reduce log spew and document test-server variants 2016-07-14 08:57:27 +08:00
test-server.h protocol generic sessions 2016-06-18 06:44:31 +08:00
test.html plugins-dim-webpage-when-connection-lost 2016-07-14 08:57:28 +08:00