add: faster broadcast on status change

This commit is contained in:
Tobias Reisinger 2020-08-15 16:06:39 +02:00
parent eca6f7f704
commit f49c760e97
2 changed files with 70 additions and 59 deletions

View file

@ -1,7 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <syslog.h>
#include <mongoose.h>
@ -142,16 +141,10 @@ main(int argc, const char** argv)
/******************** START MAIN LOOP ********************/
time_t timer = time(NULL);
for (;;)
{
mg_mgr_poll(&mgr, 200);
if(time(NULL) - timer >= 10)
{
status_broadcast(&mgr);
timer = time(NULL);
}
status_broadcast(&mgr);
}
terminate(0);