mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-19 08:03:14 +08:00
Sending messages every 10 seconds, to allow mongoose send PINGs
This commit is contained in:
parent
b6d968f00c
commit
1a17165227
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user