connect to server, do ping+pong, compute latency