pings and waits for pong using timeout