Struct NetworkParameterConstants
Default values used for the different network parameters. These parameters (except the MTU) can be set with WithNetworkConfigParameters(ref NetworkSettings, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).
Inherited Members
Namespace: Unity.Networking.Transport
Syntax
public struct NetworkParameterConstants
Fields
ConnectTimeoutMS
Default time between connection attempts.
Declaration
public const int ConnectTimeoutMS = 1000
Field Value
Type | Description |
---|---|
Int32 | Timeout in milliseconds. |
DisconnectTimeoutMS
Default inactivity timeout for a connection. If nothing is received on a connection for this amount of time, it is disconnected (a Disconnect event will be generated).
Declaration
public const int DisconnectTimeoutMS = 30000
Field Value
Type | Description |
---|---|
Int32 | Timeout in milliseconds. |
HeartbeatTimeoutMS
Default amount of time after which if nothing from a peer is received, a heartbeat message will be sent to keep the connection alive.
Declaration
public const int HeartbeatTimeoutMS = 500
Field Value
Type | Description |
---|---|
Int32 | Timeout in milliseconds. |
MaxConnectAttempts
Default maximum number of connection attempts to try. If no answer is received from the server after this number of attempts, a Disconnect event is generated for the connection.
Declaration
public const int MaxConnectAttempts = 60
Field Value
Type | Description |
---|---|
Int32 | Number of attempts. |
MTU
Maximum size of a packet that can be sent by the transport. Note that this size includes any headers that could be added by the transport (e.g. headers for DTLS or pipelines), which means the actual maximum message size that can be sent by a user is slightly less than this value. To find out what the size of these headers is, use MaxHeaderSize(NetworkPipeline). It is possible to send messages larger than that by sending them through a pipeline with a FragmentationPipelineStage.
Declaration
public const int MTU = 1400
Field Value
Type | Description |
---|---|
Int32 | Size in bytes. |
ReceiveQueueCapacity
Default capacity of the receive queue.
Declaration
public const int ReceiveQueueCapacity = 512
Field Value
Type | Description |
---|---|
Int32 | Queue capacity in number of packets. |
ReconnectionTimeoutMS
Default amount of time after which to attempt to re-establish a connection if nothing is received from the peer. This is used to re-establish connections for example when a peer's IP address changes (e.g. mobile roaming scenarios).
Declaration
public const int ReconnectionTimeoutMS = 2000
Field Value
Type | Description |
---|---|
Int32 | Timeout in milliseconds. |
SendQueueCapacity
Default capacity of the send queue.
Declaration
public const int SendQueueCapacity = 512
Field Value
Type | Description |
---|---|
Int32 | Queue capacity in number of packets. |