Time out long-poll connections after 30sec

To prune the old connections, a function is called every 1sec
with the server state.