mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +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:
parent
7ab4edebe3
commit
6aa4f65620
1 changed files with 4 additions and 3 deletions
|
@ -763,7 +763,7 @@ int main(int argc, char **argv)
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
int syslog_options = LOG_PID | LOG_PERROR;
|
int syslog_options = LOG_PID | LOG_PERROR;
|
||||||
#endif
|
#endif
|
||||||
unsigned int oldus = 0;
|
unsigned int ms, oldms = 0;
|
||||||
struct lws_context_creation_info info;
|
struct lws_context_creation_info info;
|
||||||
|
|
||||||
int debug_level = 7;
|
int debug_level = 7;
|
||||||
|
@ -909,9 +909,10 @@ int main(int argc, char **argv)
|
||||||
* as soon as it can take more packets (usually immediately)
|
* 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]);
|
libwebsocket_callback_on_writable_all_protocol(&protocols[PROTOCOL_DUMB_INCREMENT]);
|
||||||
oldus = tv.tv_usec;
|
oldms = ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXTERNAL_POLL
|
#ifdef EXTERNAL_POLL
|
||||||
|
|
Loading…
Add table
Reference in a new issue