Sending messages every 10 seconds, to allow mongoose send PINGs

This commit is contained in:
Sergey Lyubka 2013-12-18 09:34:36 +00:00
parent b6d968f00c
commit 1a17165227

View File

@ -1,6 +1,7 @@
#include <unistd.h>
#include <string.h>
#include "core.h"
#include "mongoose.h"
static void iterate_callback(struct mg_connection *c, void *param) {
if (c->is_websocket) {
@ -17,7 +18,7 @@ static void *timer_thread(void *param) {
int i;
for (i = 0; i < 9999999; i++) {
sleep(1);
sleep(10);
mg_iterate_over_connections(server, iterate_callback, &i);
}