What is the correct way of doing a correct ping test ? I am currently developing in Java for Blackberry and its capabilities are a bit limited about this.
What I am doing is to open a connection to a given URL and measure the time for this but I am not sure if this is really a correct ping time measurement. Can anyone give me some ideas ?
It sounds like which you’re looking for is the latency, which would be the time it takes for you to send some information, and receive a response from it.
If you don’t control the server, it’s not going to be wholly accurate — since you have no way of knowing how long the server spends processing your input before it sends something back.
If the server is not your own, you could plug into the standard Ping protocol (as always, wikipedia is here to save the day).
If the server is your own, and you want to avoid that, you need to set up a similar protocol – in which you send a request, and the server responds.
In both cases, you want to be measuring the time from when you have sent, to the time you receive, the ’round trip delay time’.