Struct ReliableSequencedPipelineStage
This pipeline stage can be used to ensure that packets sent through it will be delivered, and will be delivered in order. This is done by sending acknowledgements for received packets, and resending packets that have not been acknowledged in a while.
Note that a consequence of these guarantees is that if a packet is lost, subsequent packets will not be delivered until the lost packet has been resent and delivered. This is called head-of-line blocking and can add significant latency to delivered packets when it occurs. For this reason, only send through this pipeline traffic which must absolutely be delivered in order (e.g. RPCs or player actions). State updates that will be resent later anyway (e.g. snapshots) should not be sent through this pipeline stage.
Another reason to limit the amount of traffic sent through this pipeline is because it has limited bandwidth. Because of the need to keep packets around in case they need to be resent, only a limited number of packets can be in-flight at a time. This limit, called the window size, is 32 by default and can be increased to 64. See the documentation on pipelines for further details.
Implements
Inherited Members
Namespace: Unity.Networking.Transport
Assembly: Unity.Networking.Transport.dll
Syntax
[BurstCompile]
public struct ReliableSequencedPipelineStage : INetworkPipelineStage
Properties
StaticSize
Amount of data that the pipeline stage requires in "static" storage (storage shared by all instances of the pipeline stage). For example, this is often used to store configuration parameters obtained through NetworkSettings.
Declaration
public int StaticSize { get; }
Property Value
Type | Description |
---|---|
int | Size in bytes. |
Methods
StaticInitialize(byte*, int, NetworkSettings)
Initialize the static storage for the pipeline from the settings. More importantly, this method is responsible for providing the NetworkPipelineStage structure, which contains function pointers for most of the pipeline stage functionality.
Declaration
public NetworkPipelineStage StaticInitialize(byte* staticInstanceBuffer, int staticInstanceBufferLength, NetworkSettings settings)
Parameters
Type | Name | Description |
---|---|---|
byte* | staticInstanceBuffer | Static storage pointer. |
int | staticInstanceBufferLength | Static storage length. |
NetworkSettings | settings | Settings provided to the driver. |
Returns
Type | Description |
---|---|
NetworkPipelineStage | Runtime information for a pipeline instance. |