docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct NetworkConfigParameter

    The NetworkConfigParameter is used to set specific parameters that the driver uses.

    Implements
    INetworkParameter
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Networking.Transport
    Assembly: Unity.Networking.Transport.dll
    Syntax
    public struct NetworkConfigParameter : INetworkParameter

    Fields

    connectTimeoutMS

    Time between connection attempts.

    Declaration
    public int connectTimeoutMS
    Field Value
    Type Description
    int

    Timeout in milliseconds.

    disconnectTimeoutMS

    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). To prevent this from happenning when the game session is simply quiet, set heartbeatTimeoutMS to a positive non-zero value.

    Declaration
    public int disconnectTimeoutMS
    Field Value
    Type Description
    int

    Timeout in milliseconds.

    fixedFrameTimeMS

    Fixes a fixed amount of time to be used each frame for the purpose of timeout calculations. For example, setting this value to 1000 will have the driver consider that 1 second passed between each call to ScheduleUpdate(JobHandle), even if that's not actually the case. Only useful for testing scenarios, where deterministic behavior is more important than correctness.

    Declaration
    public int fixedFrameTimeMS
    Field Value
    Type Description
    int

    Timeout in milliseconds.

    heartbeatTimeoutMS

    Time after which if nothing from a peer is received, a heartbeat message will be sent to keep the connection alive. Prevents the disconnectTimeoutMS mechanism from kicking when nothing happens on a connection. A value of 0 will disable heartbeats.

    Declaration
    public int heartbeatTimeoutMS
    Field Value
    Type Description
    int

    Timeout in milliseconds.

    maxConnectAttempts

    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 int maxConnectAttempts
    Field Value
    Type Description
    int

    Number of attempts.

    maxFrameTimeMS

    Maximum amount of time a single frame can advance timeout values. In this scenario, a frame is defined as the time between two ScheduleUpdate(JobHandle) calls. Useful when debugging to avoid connection timeouts.

    Declaration
    public int maxFrameTimeMS
    Field Value
    Type Description
    int

    Timeout in milliseconds.

    maxMessageSize

    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. These headers do not include those added by the OS network stack (like UDP or IP).

    Declaration
    public int maxMessageSize
    Field Value
    Type Description
    int

    Methods

    Validate()

    Validate the settings.

    Declaration
    public bool Validate()
    Returns
    Type Description
    bool

    True if the settings are valid, false otherwise.

    Implements

    INetworkParameter
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)