[server] add a ping/pong mechanism (also measures latency)