From 94bbdce6b742ab2f62cfa9513e13f27a0f78973b Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Mon, 22 Jun 2020 01:41:52 +0200 Subject: Split idle into top-level task and per-server tasks --- server.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'server.h') diff --git a/server.h b/server.h index 46fac3f..b104ef1 100644 --- a/server.h +++ b/server.h @@ -62,7 +62,9 @@ struct server { struct uring_task_buf ann_buf; /* For checking idle status */ - struct idle *idle; + struct uring_task idle_task; + struct connection idle_conn; + struct uring_task_buf idle_buf; unsigned idle_timeout; unsigned idle_count; @@ -83,6 +85,11 @@ bool server_start(struct cfg *cfg, struct server *server); bool server_stop(struct cfg *cfg, struct server *server); +void server_set_active_players(struct cfg *cfg, struct server *server, + int count); + +bool server_idle_check(struct cfg *cfg, struct server *server); + bool server_announce(struct cfg *cfg, struct server *server, int fd); bool server_commit(struct cfg *cfg, struct server *server); -- cgit v1.2.3