introduce timeout system
authorAndy Green <andy@warmcat.com>
Mon, 14 Feb 2011 17:59:43 +0000 (17:59 +0000)
committerAndy Green <andy@warmcat.com>
Mon, 14 Feb 2011 17:59:43 +0000 (17:59 +0000)
commita71eafce5a17e82425787ddb583fc2b9f3916b3d
treea6c715df25d5b56597a8ab35d7ec03b5ce2659f3
parentb86d64eaa9585404a7b8882fb3a29f40bdefd008
introduce timeout system

This adds a concept of timeouts for operations enforced by
connection closure if the timeout is reached.

Once a second all sockets are checked for timing out, every time
there is a service call it checks to see if a second has passed since
the last check and checks if so.

You can also call libwebsocket_service_fd() with a NULL fd to give
the timeouts a chance to be detected; if it's less than a second since
the last check it returns immediately.

Signed-off-by: Andy Green <andy@warmcat.com>
lib/client-handshake.c
lib/libwebsockets.c
lib/private-libwebsockets.h