Connects to server and responds to ping