1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

test server dumb increment fix once per second duplicate

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2014-07-05 11:52:58 +08:00
parent 520d401da4
commit 51dca9a527

View file

@ -763,7 +763,7 @@ int main(int argc, char **argv)
#ifndef WIN32
int syslog_options = LOG_PID | LOG_PERROR;
#endif
unsigned int oldus = 0;
unsigned int ms, oldms = 0;
struct lws_context_creation_info info;
int debug_level = 7;
@ -909,9 +909,10 @@ int main(int argc, char **argv)
* as soon as it can take more packets (usually immediately)
*/
if (((unsigned int)tv.tv_usec - oldus) > 50000) {
ms = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
if ((ms - oldms) > 50) {
libwebsocket_callback_on_writable_all_protocol(&protocols[PROTOCOL_DUMB_INCREMENT]);
oldus = tv.tv_usec;
oldms = ms;
}
#ifdef EXTERNAL_POLL