Search Results for

    Show / Hide Table of Contents

    Class Transport

    Abstract transport layer component

    Inheritance
    Object
    Transport
    KcpTransport
    LatencySimulation
    MiddlewareTransport
    MultiplexTransport
    SimpleWebTransport
    TelepathyTransport
    Namespace: Mirror
    Assembly: doc.dll
    Syntax
    public abstract class Transport : MonoBehaviour

    Fields

    | Improve this Doc View Source

    activeTransport

    The current transport used by Mirror.

    Declaration
    public static Transport activeTransport
    Field Value
    Type Description
    Transport
    | Improve this Doc View Source

    OnClientConnected

    Called by Transport when the client connected to the server.

    Declaration
    public Action OnClientConnected
    Field Value
    Type Description
    Action
    | Improve this Doc View Source

    OnClientDataReceived

    Called by Transport when the client received a message from the server.

    Declaration
    public Action<ArraySegment<byte>, int> OnClientDataReceived
    Field Value
    Type Description
    Action<ArraySegment<Byte>, Int32>
    | Improve this Doc View Source

    OnClientDataSent

    Called by Transport when the client sent a message to the server.

    Declaration
    public Action<ArraySegment<byte>, int> OnClientDataSent
    Field Value
    Type Description
    Action<ArraySegment<Byte>, Int32>
    | Improve this Doc View Source

    OnClientDisconnected

    Called by Transport when the client disconnected from the server.

    Declaration
    public Action OnClientDisconnected
    Field Value
    Type Description
    Action
    | Improve this Doc View Source

    OnClientError

    Called by Transport when the client encountered an error.

    Declaration
    public Action<TransportError, string> OnClientError
    Field Value
    Type Description
    Action<TransportError, String>
    | Improve this Doc View Source

    OnServerConnected

    Called by Transport when a new client connected to the server.

    Declaration
    public Action<int> OnServerConnected
    Field Value
    Type Description
    Action<Int32>
    | Improve this Doc View Source

    OnServerDataReceived

    Called by Transport when the server received a message from a client.

    Declaration
    public Action<int, ArraySegment<byte>, int> OnServerDataReceived
    Field Value
    Type Description
    Action<Int32, ArraySegment<Byte>, Int32>
    | Improve this Doc View Source

    OnServerDataSent

    Called by Transport when the server sent a message to a client.

    Declaration
    public Action<int, ArraySegment<byte>, int> OnServerDataSent
    Field Value
    Type Description
    Action<Int32, ArraySegment<Byte>, Int32>
    | Improve this Doc View Source

    OnServerDisconnected

    Called by Transport when a client disconnected from the server.

    Declaration
    public Action<int> OnServerDisconnected
    Field Value
    Type Description
    Action<Int32>
    | Improve this Doc View Source

    OnServerError

    Called by Transport when a server's connection encountered a problem.

    Declaration
    public Action<int, TransportError, string> OnServerError
    Field Value
    Type Description
    Action<Int32, TransportError, String>

    Methods

    | Improve this Doc View Source

    Available()

    Is this transport available in the current platform?

    Declaration
    public abstract bool Available()
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    ClientConnect(String)

    Connects the client to the server at the address.

    Declaration
    public abstract void ClientConnect(string address)
    Parameters
    Type Name Description
    String address
    | Improve this Doc View Source

    ClientConnect(Uri)

    Connects the client to the server at the Uri.

    Declaration
    public virtual void ClientConnect(Uri uri)
    Parameters
    Type Name Description
    Uri uri
    | Improve this Doc View Source

    ClientConnected()

    True if the client is currently connected to the server.

    Declaration
    public abstract bool ClientConnected()
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    ClientDisconnect()

    Disconnects the client from the server

    Declaration
    public abstract void ClientDisconnect()
    | Improve this Doc View Source

    ClientEarlyUpdate()

    NetworkLoop NetworkEarly/LateUpdate were added for a proper network update order. the goal is to: process_incoming() update_world() process_outgoing() in order to avoid unnecessary latency and data races.

    Declaration
    public virtual void ClientEarlyUpdate()
    | Improve this Doc View Source

    ClientLateUpdate()

    Declaration
    public virtual void ClientLateUpdate()
    | Improve this Doc View Source

    ClientSend(ArraySegment<Byte>, Int32)

    Sends a message to the server over the given channel.

    Declaration
    public abstract void ClientSend(ArraySegment<byte> segment, int channelId = null)
    Parameters
    Type Name Description
    ArraySegment<Byte> segment
    Int32 channelId
    | Improve this Doc View Source

    GetBatchThreshold(Int32)

    Recommended Batching threshold for this transport.

    Declaration
    public virtual int GetBatchThreshold(int channelId = null)
    Parameters
    Type Name Description
    Int32 channelId
    Returns
    Type Description
    Int32
    | Improve this Doc View Source

    GetMaxPacketSize(Int32)

    Maximum message size for the given channel.

    Declaration
    public abstract int GetMaxPacketSize(int channelId = null)
    Parameters
    Type Name Description
    Int32 channelId
    Returns
    Type Description
    Int32
    | Improve this Doc View Source

    LateUpdate()

    Declaration
    public void LateUpdate()
    | Improve this Doc View Source

    OnApplicationQuit()

    Called by Unity when quitting. Inheriting Transports should call base for proper Shutdown.

    Declaration
    public virtual void OnApplicationQuit()
    | Improve this Doc View Source

    ServerActive()

    True if the server is currently listening for connections.

    Declaration
    public abstract bool ServerActive()
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    ServerDisconnect(Int32)

    Disconnect a client from the server.

    Declaration
    public abstract void ServerDisconnect(int connectionId)
    Parameters
    Type Name Description
    Int32 connectionId
    | Improve this Doc View Source

    ServerEarlyUpdate()

    Declaration
    public virtual void ServerEarlyUpdate()
    | Improve this Doc View Source

    ServerGetClientAddress(Int32)

    Get a client's address on the server.

    Declaration
    public abstract string ServerGetClientAddress(int connectionId)
    Parameters
    Type Name Description
    Int32 connectionId
    Returns
    Type Description
    String
    | Improve this Doc View Source

    ServerLateUpdate()

    Declaration
    public virtual void ServerLateUpdate()
    | Improve this Doc View Source

    ServerSend(Int32, ArraySegment<Byte>, Int32)

    Send a message to a client over the given channel.

    Declaration
    public abstract void ServerSend(int connectionId, ArraySegment<byte> segment, int channelId = null)
    Parameters
    Type Name Description
    Int32 connectionId
    ArraySegment<Byte> segment
    Int32 channelId
    | Improve this Doc View Source

    ServerStart()

    Start listening for connections.

    Declaration
    public abstract void ServerStart()
    | Improve this Doc View Source

    ServerStop()

    Stop listening and disconnect all connections.

    Declaration
    public abstract void ServerStop()
    | Improve this Doc View Source

    ServerUri()

    Returns server address as Uri.

    Declaration
    public abstract Uri ServerUri()
    Returns
    Type Description
    Uri
    | Improve this Doc View Source

    Shutdown()

    Shut down the transport, both as client and server

    Declaration
    public abstract void Shutdown()
    | Improve this Doc View Source

    Update()

    Declaration
    public void Update()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX