Skip to content
Snippets Groups Projects
Commit 1a171652 authored by Sergey Lyubka's avatar Sergey Lyubka
Browse files

Sending messages every 10 seconds, to allow mongoose send PINGs

parent b6d968f0
No related branches found
No related tags found
No related merge requests found
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include "core.h"
#include "mongoose.h"
static void iterate_callback(struct mg_connection *c, void *param) { static void iterate_callback(struct mg_connection *c, void *param) {
if (c->is_websocket) { if (c->is_websocket) {
...@@ -17,7 +18,7 @@ static void *timer_thread(void *param) { ...@@ -17,7 +18,7 @@ static void *timer_thread(void *param) {
int i; int i;
for (i = 0; i < 9999999; i++) { for (i = 0; i < 9999999; i++) {
sleep(1); sleep(10);
mg_iterate_over_connections(server, iterate_callback, &i); mg_iterate_over_connections(server, iterate_callback, &i);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment