docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RelayTransport

    Inheritance
    object
    RelayTransport
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: MLAPI.Transports.UNET
    Assembly: Unity.Multiplayer.MLAPI.Runtime.dll
    Syntax
    public static class RelayTransport

    Properties

    Enabled

    Declaration
    public static bool Enabled { get; set; }
    Property Value
    Type Description
    bool

    RelayAddress

    Declaration
    public static string RelayAddress { get; set; }
    Property Value
    Type Description
    string

    RelayPort

    Declaration
    public static ushort RelayPort { get; set; }
    Property Value
    Type Description
    ushort

    Methods

    AddHost(HostTopology, bool)

    Declaration
    public static int AddHost(HostTopology topology, bool createServer)
    Parameters
    Type Name Description
    HostTopology topology
    bool createServer
    Returns
    Type Description
    int

    AddHost(HostTopology, int, bool)

    Declaration
    public static int AddHost(HostTopology topology, int port, bool createServer)
    Parameters
    Type Name Description
    HostTopology topology
    int port
    bool createServer
    Returns
    Type Description
    int

    AddHost(HostTopology, int, string, bool)

    Declaration
    public static int AddHost(HostTopology topology, int port, string ip, bool createServer)
    Parameters
    Type Name Description
    HostTopology topology
    int port
    string ip
    bool createServer
    Returns
    Type Description
    int

    AddHostWithSimulator(HostTopology, int, int, bool)

    Declaration
    public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, bool createServer)
    Parameters
    Type Name Description
    HostTopology topology
    int minTimeout
    int maxTimeout
    bool createServer
    Returns
    Type Description
    int

    AddHostWithSimulator(HostTopology, int, int, int, bool)

    Declaration
    public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, int port, bool createServer)
    Parameters
    Type Name Description
    HostTopology topology
    int minTimeout
    int maxTimeout
    int port
    bool createServer
    Returns
    Type Description
    int

    AddHostWithSimulator(HostTopology, int, int, int, string, bool)

    Declaration
    public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, int port, string ip, bool createServer)
    Parameters
    Type Name Description
    HostTopology topology
    int minTimeout
    int maxTimeout
    int port
    string ip
    bool createServer
    Returns
    Type Description
    int

    AddWebsocketHost(HostTopology, int, bool)

    Declaration
    public static int AddWebsocketHost(HostTopology topology, int port, bool createServer)
    Parameters
    Type Name Description
    HostTopology topology
    int port
    bool createServer
    Returns
    Type Description
    int

    AddWebsocketHost(HostTopology, int, string, bool)

    Declaration
    public static int AddWebsocketHost(HostTopology topology, int port, string ip, bool createServer)
    Parameters
    Type Name Description
    HostTopology topology
    int port
    string ip
    bool createServer
    Returns
    Type Description
    int

    Connect(int, string, int, int, out byte)

    Declaration
    public static int Connect(int hostId, string serverAddress, int serverPort, int exceptionConnectionId, out byte error)
    Parameters
    Type Name Description
    int hostId
    string serverAddress
    int serverPort
    int exceptionConnectionId
    byte error
    Returns
    Type Description
    int

    ConnectEndPoint(int, EndPoint, int, out byte)

    Declaration
    public static int ConnectEndPoint(int hostId, EndPoint endPoint, int exceptionConnectionId, out byte error)
    Parameters
    Type Name Description
    int hostId
    EndPoint endPoint
    int exceptionConnectionId
    byte error
    Returns
    Type Description
    int

    ConnectWithSimulator(int, string, int, int, out byte, ConnectionSimulatorConfig)

    Declaration
    public static int ConnectWithSimulator(int hostId, string serverAddress, int serverPort, int exceptionConnectionId, out byte error, ConnectionSimulatorConfig conf)
    Parameters
    Type Name Description
    int hostId
    string serverAddress
    int serverPort
    int exceptionConnectionId
    byte error
    ConnectionSimulatorConfig conf
    Returns
    Type Description
    int

    Disconnect(int, int, out byte)

    Declaration
    public static bool Disconnect(int hostId, int connectionId, out byte error)
    Parameters
    Type Name Description
    int hostId
    int connectionId
    byte error
    Returns
    Type Description
    bool

    QueueMessageForSending(int, int, int, byte[], int, out byte)

    Declaration
    public static bool QueueMessageForSending(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error)
    Parameters
    Type Name Description
    int hostId
    int connectionId
    int channelId
    byte[] buffer
    int size
    byte error
    Returns
    Type Description
    bool

    Receive(out int, out int, out int, byte[], int, out int, out byte)

    Declaration
    public static NetworkEventType Receive(out int hostId, out int connectionId, out int channelId, byte[] buffer, int bufferSize, out int receivedSize, out byte error)
    Parameters
    Type Name Description
    int hostId
    int connectionId
    int channelId
    byte[] buffer
    int bufferSize
    int receivedSize
    byte error
    Returns
    Type Description
    NetworkEventType

    ReceiveFromHost(int, out int, out int, byte[], int, out int, out byte)

    Declaration
    public static NetworkEventType ReceiveFromHost(int hostId, out int connectionId, out int channelId, byte[] buffer, int bufferSize, out int receivedSize, out byte error)
    Parameters
    Type Name Description
    int hostId
    int connectionId
    int channelId
    byte[] buffer
    int bufferSize
    int receivedSize
    byte error
    Returns
    Type Description
    NetworkEventType

    Send(int, int, int, byte[], int, out byte)

    Declaration
    public static bool Send(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error)
    Parameters
    Type Name Description
    int hostId
    int connectionId
    int channelId
    byte[] buffer
    int size
    byte error
    Returns
    Type Description
    bool

    SendQueuedMessages(int, int, out byte)

    Declaration
    public static bool SendQueuedMessages(int hostId, int connectionId, out byte error)
    Parameters
    Type Name Description
    int hostId
    int connectionId
    byte error
    Returns
    Type Description
    bool

    Events

    OnRemoteEndpointReported

    Declaration
    public static event Action<IPEndPoint> OnRemoteEndpointReported
    Event Type
    Type Description
    Action<IPEndPoint>
    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)