Ping
Internal ping calculation
The client uses QueryPerformanceCounter to generate an arbitrary timestamp, which it converts roughly into milliseconds by dividing it by 10,000.
An IPC message is sent by the client which includes the timestamp encoded as a 32-bit integer value.
An IPC message is sent back by the server with the same timestamp.
The client generates a new timestamp, divides it by 10,000, and then computes the difference between them to get the RTT for the connection.
Pseudocode
Remarks
Because the server copies the same timestamp into the response message as is in the request message, ping calculation can be done in a stateless manner with respect to the client.
Last updated