TestNetworkLatency |
Top Previous Next |
Message
TestNetworkLatency
Originator
Client
Details
If the client sends TestNetworkLatency, the server will send Ping. The client should respond with PingAcknowledged as soon as possible. The server will calculate the time difference between sending the Ping and receiving the PingAcknowledged and report it in the following manner:
Info: Network latency is 15 ms
Do not send multiple TestNetworkLatency messages very fast, as the server doesn't keep track of multiple outstanding Pings. You will get an abnormally high value as the server matches the PingAcknowledged with a much earlier Ping, or something like that.
If the client wants to test the network latency itself, it can send a Ping; the server will respond immediately with a PingAcknowledged. The TestNetworkLatency command just saves the client the effort of calculating the time difference.
The Whisker test client supports Ping/PingAcknowledged, as does the C++ client library and the SDK.
These commands are supported on the immediate socket. That is to say, whichever socket you send the command on, the following replies are received on the same socket:
TestNetworkLatency → Ping
Ping → PingAcknowledged
PingAcknowledged → Info: Network latency is <latency> ms [on the main socket] or PingAcknowledged → <latency> [on the immediate socket]
Revision history
Implemented in WhiskerServer version 1.
See also
|