mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-03 13:28:44 +00:00
Fix #1520 - move state to struct mg_mgr
This commit is contained in:
1 parent
66376885e9
commit
ef44f90491
24 files changed
+218
-276
No files matched your search
@@ -54,13 +54,11 @@ static void timer_callback(void *arg) {
|
||||
|
||||
int main(void) {
|
||||
struct mg_mgr mgr;
|
||||
struct mg_timer t1;
|
||||
|
||||
mg_mgr_init(&mgr);
|
||||
mg_http_listen(&mgr, "http://localhost:8000", cb, NULL);
|
||||
mg_timer_init(&t1, 500, MG_TIMER_REPEAT, timer_callback, &mgr);
|
||||
mg_timer_add(&mgr, 500, MG_TIMER_REPEAT, timer_callback, &mgr);
|
||||
for (;;) mg_mgr_poll(&mgr, 50);
|
||||
mg_timer_free(&t1);
|
||||
mg_mgr_free(&mgr);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user