Class UNetTransport
Inheritance
UNetTransport
Assembly: Unity.Multiplayer.MLAPI.Runtime.dll
Syntax
public class UNetTransport : NetworkTransport, ITransportProfilerData
Fields
Channels
Declaration
public List<UNetChannel> Channels
Field Value
ConnectAddress
Declaration
public string ConnectAddress
Field Value
ConnectPort
Declaration
Field Value
MLAPIRelayAddress
Declaration
public string MLAPIRelayAddress
Field Value
MLAPIRelayPort
Declaration
public int MLAPIRelayPort
Field Value
MaxConnections
Declaration
public int MaxConnections
Field Value
MaxSentMessageQueueSize
Declaration
public int MaxSentMessageQueueSize
Field Value
MessageBufferSize
Declaration
public int MessageBufferSize
Field Value
MessageSendMode
Declaration
public UNetTransport.SendMode MessageSendMode
Field Value
ProfilerEnabled
Declaration
public static bool ProfilerEnabled
Field Value
ServerListenPort
Declaration
public int ServerListenPort
Field Value
ServerWebsocketListenPort
Declaration
public int ServerWebsocketListenPort
Field Value
SupportWebsocket
Declaration
public bool SupportWebsocket
Field Value
UseMLAPIRelay
Declaration
public bool UseMLAPIRelay
Field Value
Properties
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
Overrides
Methods
AddMLAPIChannel(NetworkDelivery, ConnectionConfig)
Declaration
public int AddMLAPIChannel(NetworkDelivery type, ConnectionConfig config)
Parameters
Returns
AddUNETChannel(QosType, ConnectionConfig)
Declaration
public int AddUNETChannel(QosType type, ConnectionConfig config)
Parameters
Returns
BeginNewTick()
Declaration
public void BeginNewTick()
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
GetConfig()
Declaration
public ConnectionConfig GetConfig()
Returns
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
GetMLAPIClientId(byte, ushort, bool)
Declaration
public ulong GetMLAPIClientId(byte hostId, ushort connectionId, bool isServer)
Parameters
Returns
GetTransportProfilerData()
Declaration
public IReadOnlyDictionary<string, int> GetTransportProfilerData()
Returns
GetUNetConnectionDetails(ulong, out byte, out ushort)
Declaration
public void GetUNetConnectionDetails(ulong clientId, out byte hostId, out ushort connectionId)
Parameters
Init()
Initializes the transport
Declaration
public override void Init()
Overrides
LateUpdate()
Declaration
protected void LateUpdate()
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
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
Overrides
SendQueued(ulong)
Declaration
public void SendQueued(ulong clientId)
Parameters
Type |
Name |
Description |
ulong |
clientId |
|
Shutdown()
Declaration
public override void Shutdown()
Overrides
StartClient()
Connects client to server
Declaration
public override SocketTasks StartClient()
Returns
Overrides
StartServer()
Starts to listen for incoming clients.
Declaration
public override SocketTasks StartServer()
Returns
Overrides
Implements