Advertisement

Calculating ping

Started by November 25, 2001 09:06 AM
2 comments, last by MadProgrammer 22 years, 10 months ago
this is my idea for calculating ping, tell me if im right, close, or dead wrong. Every so often (or imbedded in every other packe) the client sends a "ping" packet to the server that includes the clients Tick count when the client sent it. the server then immediately sends that packet back to the client, not changing the tick count. the client then subtracts the tick count in the packet from the current tick count, divides by 2, and wala! (i think) is that how its done?
really close, but don''t divide it by 2 because ping is the time measured between the packet''s ''start''(when you send it) and it''s ''end'' (when you got it back).
Advertisement
thanks
In case you''re interested, Microsoft have an ICMP library (the protocol used for ping) which is freely available.

Do a search on Microsoft for ICMP API
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan

This topic is closed to new replies.

Advertisement