Hi Simon

Instead of "ping", you could use your own "chat-network" to measure the connection quality within your network:

Define two new "lobby command messages" ping and pong. Send a ping together with the actual "time" from A to B. B sends the value "time" back to A (pong). A calclulates the difference between the actual time and the one received in the message.

A sends a ping message to B at 1839313
A -> B :  PING&1839313

B receives PING&1839313 from A. B sends the message back to A:
B->A :  PONG&1839313

A receives the message pong from B at 1839356
and calculates the RTD = 1839356 - 1839313 = 43

Time: Use f.e. QueryPerformanceCounter

Do NOT use GetTickCount - (The resolution of the GetTickCount <http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408%28v=vs.85%29.aspx> function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds.)


Am 14.12.2014 23:53, schrieb Simon Lewis:
Am looking for a quick dirty way to get users MS ping from main chat server to 
client I seen a ping demo in src but seams over complex is there a easier way 
to get users ping speed?

Thanks alot

To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to