NetworkSession.SimulatedPacketLoss Property

Gets or sets the amount of simulated packet loss.

Namespace: Microsoft.Xna.Framework.Net
Assembly: Microsoft.Xna.Framework.Net (in microsoft.xna.framework.net.dll)

Syntax

public float SimulatedPacketLoss { get; set; }

Property Value

The amount of simulated packet loss, expressed as any fractional probability in the range 0 to 1, with 1 causing 100% packet loss. The default value is zero.

Remarks

SimulatedPacketLoss is useful if you are testing a system link game on a fast local network and want to make sure it will also work correctly over the Internet. Xbox games are typically expected to work with up to 0.1 (10%) packet loss.

The packet loss simulation is applied on the sending machine, so if you set this property differently on each machine, only outgoing packets will be affected by the local value of the property.

Packets sent using SendDataOptions.Reliable are not affected by this setting.

Warning

The packet loss and latency simulation in the XNA Framework applies to messages that are sent to all players, including local players. In game designs where data to local players is sent and received using the network session SendData methods, local players will experience the set values for simulated packet loss and latency. To work around this issue, avoid broadcasting messages to all users and set SimulatedPacketLoss and SimulatedLatency on a per-send basis.

See Also

Reference

NetworkSession Class
NetworkSession Members
Microsoft.Xna.Framework.Net Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP