An object used by NetworkLatencySimulator to provide the latency scheduling.
It models the average latency to the server and has a delay period to simulate the spikes often seen with TCP connections due to dropped packets. It randomizes the time periods to provide more variation.
Users can implement their own behavior object if they want to simulate specific conditions.
Summary
Creates an object to pass to the NetworkLatencySimulator.create().
Syntax
var behavior = NetworkLatencyBehavior.create({latency : 50,
delayPeriod : 1000,
delayDuration : 100});
var simulator = NetworkLatencySimulator.create(behavior);
This is the simulated latency to the server in ms. The total latencies will be:
Total latency (to server) = (simulated latency + actual latency to/from server) x 2
Total latency (to other client) = (simulated latency + actual latency to/from server) x 2 + (other client’s simulated latency + other client’s actual latency to/from server) x 2
For a local server the actual latency is typically <30ms where as a remote server will depend on location and connection.