add: faster broadcast on status change
This commit is contained in:
parent
eca6f7f704
commit
f49c760e97
2 changed files with 70 additions and 59 deletions
src
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue