Class MultiplexTransportAdapter
Multiplex transport adapter.
Inheritance
Inherited Members
Namespace: MLAPI.Transports.Multiplex
Assembly: Unity.Multiplayer.MLAPI.Runtime.dll
Syntax
public class MultiplexTransportAdapter : NetworkTransport
Fields
SpreadMethod
Declaration
public MultiplexTransportAdapter.ConnectionIdSpreadMethod SpreadMethod
Field Value
| Type | Description |
|---|---|
| MultiplexTransportAdapter.ConnectionIdSpreadMethod |
Transports
Declaration
public NetworkTransport[] Transports
Field Value
| Type | Description |
|---|---|
| NetworkTransport[] |
Properties
IsSupported
Gets a value indicating whether this MLAPI.Transports.Transport is supported in the current runtime context. This is used by multiplex adapters.
Declaration
public override bool IsSupported { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Overrides
ServerClientId
A constant clientId that represents the server. When this value is found in methods such as Send, it should be treated as a placeholder that means "the server"
Declaration
public override ulong ServerClientId { get; }
Property Value
| Type | Description |
|---|---|
| ulong |
Overrides
Methods
DisconnectLocalClient()
Disconnects the local client from the server
Declaration
public override void DisconnectLocalClient()
Overrides
DisconnectRemoteClient(ulong)
Disconnects a client from the server
Declaration
public override void DisconnectRemoteClient(ulong clientId)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | clientId | The clientId to disconnect |
Overrides
GetCurrentRtt(ulong)
Gets the round trip time for a specific client. This method is optional
Declaration
public override ulong GetCurrentRtt(ulong clientId)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | clientId | The clientId to get the rtt from |
Returns
| Type | Description |
|---|---|
| ulong | Returns the round trip time in milliseconds |
Overrides
GetFirstSupportedTransportIndex()
Declaration
public byte GetFirstSupportedTransportIndex()
Returns
| Type | Description |
|---|---|
| byte |
GetMLAPIClientId(byte, ulong, bool)
Declaration
public ulong GetMLAPIClientId(byte transportId, ulong connectionId, bool isServer)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | transportId | |
| ulong | connectionId | |
| bool | isServer |
Returns
| Type | Description |
|---|---|
| ulong |
GetMultiplexTransportDetails(ulong, out byte, out ulong)
Declaration
public void GetMultiplexTransportDetails(ulong clientId, out byte transportId, out ulong connectionId)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | clientId | |
| byte | transportId | |
| ulong | connectionId |
Init()
Initializes the transport
Declaration
public override void Init()
Overrides
PollEvent(out ulong, out NetworkChannel, out ArraySegment<byte>, out float)
Polls for incoming events, with an extra output parameter to report the precise time the event was received.
Declaration
public override NetworkEvent PollEvent(out ulong clientId, out NetworkChannel networkChannel, out ArraySegment<byte> payload, out float receiveTime)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | clientId | The clientId this event is for |
| NetworkChannel | networkChannel | |
| ArraySegment<byte> | payload | The incoming data payload |
| float | receiveTime | The time the event was received, as reported by Time.realtimeSinceStartup. |
Returns
| Type | Description |
|---|---|
| NetworkEvent | Returns the event type |
Overrides
Send(ulong, ArraySegment<byte>, NetworkChannel)
Send a payload to the specified clientId, data and channelName.
Declaration
public override void Send(ulong clientId, ArraySegment<byte> data, NetworkChannel networkChannel)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | clientId | The clientId to send to |
| ArraySegment<byte> | data | The data to send |
| NetworkChannel | networkChannel |
Overrides
Shutdown()
Shuts down the transport
Declaration
public override void Shutdown()
Overrides
StartClient()
Connects client to server
Declaration
public override SocketTasks StartClient()
Returns
| Type | Description |
|---|---|
| SocketTasks |
Overrides
StartServer()
Starts to listen for incoming clients.
Declaration
public override SocketTasks StartServer()
Returns
| Type | Description |
|---|---|
| SocketTasks |