onRoundTripResponse()
Availability:
Flash Player 7, 8
SmartFoxServer Lite / Basic / Pro
Usage:
smartFox.onRoundTripResponse(time:Number)
Description:
This event is fired when the server responds to a roundTripBench() request.
The roundtrip time represents the amount of milliseconds that it takes
a message to go from the client to the server and get back to the client.
A good way to measure the network lag is to send continuos requests (say every
3 to 5 seconds) and then calculating the average value on a fixed
number of responses (i.e. the last 10 results)
Parameters:
time | trip time expressed in milliseconds |
Returns:
nothing
Example:
smartFox.onRoundTripResponse = function(time:Number) { pingTime:Number = time / 2 trace("Average roundtrip time: " + pingTime) }
See also: