networking · beginner · ~15 min
Track concurrent connection count.
A server processes 'c' (a client connected) and 'd' (a client disconnected). Implement int active_connections(const char *ops) returning the number connected at the end (a 'd' with none connected is ignored).
int active_connections(const char *ops) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.