2016-05-12 04:36:12 +08:00
|
|
|
---
|
|
|
|
title: "mg_next()"
|
|
|
|
decl_name: "mg_next"
|
|
|
|
symbol_kind: "func"
|
|
|
|
signature: |
|
2017-03-15 08:37:45 +08:00
|
|
|
struct mg_connection *mg_next(struct mg_mgr *mgr, struct mg_connection *c);
|
2016-05-12 04:36:12 +08:00
|
|
|
---
|
|
|
|
|
2016-07-26 22:53:33 +08:00
|
|
|
Iterates over all active connections.
|
2016-05-12 04:36:12 +08:00
|
|
|
|
2016-07-26 22:53:33 +08:00
|
|
|
Returns the next connection from the list
|
|
|
|
of active connections or `NULL` if there are no more connections. Below
|
2016-05-12 04:36:12 +08:00
|
|
|
is the iteration idiom:
|
|
|
|
|
|
|
|
```c
|
|
|
|
for (c = mg_next(srv, NULL); c != NULL; c = mg_next(srv, c)) {
|
|
|
|
// Do something with connection `c`
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|