docs.unity3d.com
    Show / Hide Table of Contents

    Struct NetworkSettings

    An aggregate of the different parameter structures that describe a network configuration.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Networking.Transport
    Syntax
    public struct NetworkSettings : IDisposable

    Constructors

    NetworkSettings(Allocator)

    Creates a new settings object using the provided allocator. If no allocator is provided, Allocator.Temp will be used.

    Declaration
    public NetworkSettings(Allocator allocator)
    Parameters
    Type Name Description
    Allocator allocator

    Allocator to use to create the object.

    Properties

    IsCreated

    If the settings have been created (e.g. not disposed).

    Declaration
    public readonly bool IsCreated { get; }
    Property Value
    Type Description
    Boolean

    True if created, false otherwise.

    Methods

    AddRawParameterStruct<T>(ref T)

    Add a new parameter structure to the list. Only one instance of any parameter type is stored at a time. Adding a new instance of an existing parameter structure will overwrite the one that is already stored.

    Declaration
    public void AddRawParameterStruct<T>(ref T parameter)
        where T : struct, INetworkParameter
    Parameters
    Type Name Description
    T parameter

    Parameter structure to add.

    Type Parameters
    Name Description
    T

    Type of INetworkParameter to add.

    Exceptions
    Type Condition
    ArgumentException

    If the parameters contain invalid values. Note that this exception is only thrown when collections checks are enabled (i.e. in the editor). Otherwise an error is logged and the parameters are added anyway.

    AsReadOnly()

    Get a read-only copy of the settings.

    Declaration
    public NetworkSettings AsReadOnly()
    Returns
    Type Description
    NetworkSettings

    A read-only copy of the settings.

    Dispose()

    Declaration
    public void Dispose()
    Implements
    IDisposable.Dispose()

    TryGet<T>(out T)

    Try to get the parameter structure for the specified type.

    Declaration
    public bool TryGet<T>(out T parameter)
        where T : struct, INetworkParameter
    Parameters
    Type Name Description
    T parameter

    Stored parameter structure (if true is returned).

    Returns
    Type Description
    Boolean

    True if the parameter structure is in the settings.

    Type Parameters
    Name Description
    T

    Type of the parameter structure to get.

    Extension Methods

    BaselibNetworkParameterExtensions.WithBaselibNetworkInterfaceParameters(ref NetworkSettings, Int32, Int32, UInt32)
    CommonNetworkParametersExtensions.WithNetworkConfigParameters(ref NetworkSettings, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
    CommonNetworkParametersExtensions.GetNetworkConfigParameters(ref NetworkSettings)
    NetworkSimulatorParameterExtensions.WithNetworkSimulatorParameters(ref NetworkSettings, Single, Single)
    FragmentationStageParameterExtensions.WithFragmentationStageParameters(ref NetworkSettings, Int32)
    FragmentationStageParameterExtensions.GetFragmentationStageParameters(ref NetworkSettings)
    ReliableStageParameterExtensions.WithReliableStageParameters(ref NetworkSettings, Int32, Int32, Int32)
    ReliableStageParameterExtensions.GetReliableStageParameters(ref NetworkSettings)
    SimulatorStageParameterExtensions.WithSimulatorStageParameters(ref NetworkSettings, Int32, Int32, ApplyMode, Int32, Int32, Int32, Int32, Int32, Int32, Int32, UInt32)
    SimulatorStageParameterExtensions.GetSimulatorStageParameters(ref NetworkSettings)
    LoggingParameterExtensions.WithLoggingParameters(ref NetworkSettings, FixedString32Bytes)
    RelayParameterExtensions.WithRelayParameters(ref NetworkSettings, ref RelayServerData, Int32)
    RelayParameterExtensions.GetRelayParameters(ref NetworkSettings)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023