Ping method

Added a method to send the ping command to the server.