mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-18 10:59:45 +00:00
Sending messages every 10 seconds, to allow mongoose send PINGs
This commit is contained in:
1 parent
b6d968f00c
commit
1a17165227
1 file changed
+3
-2
+3
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user