Class UnityTransport
Inheritance
UnityTransport
Syntax
public class UnityTransport : NetworkTransport, INetworkStreamDriverConstructor
Fields
ConnectionData
Declaration
public UnityTransport.ConnectionAddressData ConnectionData
Field Value
DebugSimulator
Declaration
public UnityTransport.SimulatorParameters DebugSimulator
Field Value
InitialMaxPacketQueueSize
Declaration
public const int InitialMaxPacketQueueSize = null
Field Value
InitialMaxPayloadSize
Declaration
public const int InitialMaxPayloadSize = null
Field Value
InitialMaxSendQueueSize
Declaration
public const int InitialMaxSendQueueSize = null
Field Value
s_DriverConstructor
Declaration
public static INetworkStreamDriverConstructor s_DriverConstructor
Field Value
Properties
DriverConstructor
Declaration
public INetworkStreamDriverConstructor DriverConstructor { get; }
Property Value
Protocol
Declaration
public UnityTransport.ProtocolType Protocol { get; }
Property Value
ServerClientId
Declaration
public override ulong ServerClientId { get; }
Property Value
Methods
CreateDriver(UnityTransport, out NetworkDriver, out NetworkPipeline, out NetworkPipeline, out NetworkPipeline)
Declaration
public void CreateDriver(UnityTransport transport, out NetworkDriver driver, out NetworkPipeline unreliableFragmentedPipeline, out NetworkPipeline unreliableSequencedFragmentedPipeline, out NetworkPipeline reliableSequencedPipeline)
Parameters
Type |
Name |
Description |
UnityTransport |
transport |
|
NetworkDriver |
driver |
|
NetworkPipeline |
unreliableFragmentedPipeline |
|
NetworkPipeline |
unreliableSequencedFragmentedPipeline |
|
NetworkPipeline |
reliableSequencedPipeline |
|
Implements
DisconnectLocalClient()
Declaration
public override void DisconnectLocalClient()
DisconnectRemoteClient(UInt64)
Declaration
public override void DisconnectRemoteClient(ulong clientId)
Parameters
Type |
Name |
Description |
UInt64 |
clientId |
|
GetCurrentRtt(UInt64)
Declaration
public override ulong GetCurrentRtt(ulong clientId)
Parameters
Type |
Name |
Description |
UInt64 |
clientId |
|
Returns
Initialize(NetworkManager)
Declaration
public override void Initialize(NetworkManager networkManager = null)
Parameters
Type |
Name |
Description |
NetworkManager |
networkManager |
|
PollEvent(out UInt64, out ArraySegment<Byte>, out Single)
Declaration
public override NetworkEvent PollEvent(out ulong clientId, out ArraySegment<byte> payload, out float receiveTime)
Parameters
Type |
Name |
Description |
UInt64 |
clientId |
|
ArraySegment<Byte> |
payload |
|
Single |
receiveTime |
|
Returns
Send(UInt64, ArraySegment<Byte>, NetworkDelivery)
Declaration
public override void Send(ulong clientId, ArraySegment<byte> payload, NetworkDelivery networkDelivery)
Parameters
Type |
Name |
Description |
UInt64 |
clientId |
|
ArraySegment<Byte> |
payload |
|
NetworkDelivery |
networkDelivery |
|
SetClientRelayData(String, UInt16, Byte[], Byte[], Byte[], Byte[], Boolean)
Set the relay server data for the host.
Declaration
public void SetClientRelayData(string ipAddress, ushort port, byte[] allocationId, byte[] key, byte[] connectionData, byte[] hostConnectionData, bool isSecure = false)
Parameters
Type |
Name |
Description |
String |
ipAddress |
IP address of the relay server.
|
UInt16 |
port |
UDP port of the relay server.
|
Byte[] |
allocationId |
Allocation ID as a byte array.
|
Byte[] |
key |
Allocation key as a byte array.
|
Byte[] |
connectionData |
Connection data as a byte array.
|
Byte[] |
hostConnectionData |
Host's connection data as a byte array.
|
Boolean |
isSecure |
Whether the connection is secure (uses DTLS).
|
SetConnectionData(NetworkEndPoint, NetworkEndPoint)
Declaration
public void SetConnectionData(NetworkEndPoint endPoint, NetworkEndPoint listenEndPoint = null)
Parameters
Type |
Name |
Description |
NetworkEndPoint |
endPoint |
|
NetworkEndPoint |
listenEndPoint |
|
SetConnectionData(String, UInt16, String)
Declaration
public void SetConnectionData(string ipv4Address, ushort port, string listenAddress = null)
Parameters
SetDebugSimulatorParameters(Int32, Int32, Int32)
Set the parameters for the debug simulator.
Declaration
public void SetDebugSimulatorParameters(int packetDelay, int packetJitter, int dropRate)
Parameters
Type |
Name |
Description |
Int32 |
packetDelay |
Packet delay in milliseconds.
|
Int32 |
packetJitter |
Packet jitter in milliseconds.
|
Int32 |
dropRate |
Packet drop percentage.
|
SetHostRelayData(String, UInt16, Byte[], Byte[], Byte[], Boolean)
Set the relay server data for the host.
Declaration
public void SetHostRelayData(string ipAddress, ushort port, byte[] allocationId, byte[] key, byte[] connectionData, bool isSecure = false)
Parameters
Type |
Name |
Description |
String |
ipAddress |
IP address of the relay server.
|
UInt16 |
port |
UDP port of the relay server.
|
Byte[] |
allocationId |
Allocation ID as a byte array.
|
Byte[] |
key |
Allocation key as a byte array.
|
Byte[] |
connectionData |
Connection data as a byte array.
|
Boolean |
isSecure |
Whether the connection is secure (uses DTLS).
|
SetRelayServerData(String, UInt16, Byte[], Byte[], Byte[], Byte[], Boolean)
Declaration
public void SetRelayServerData(string ipv4Address, ushort port, byte[] allocationIdBytes, byte[] keyBytes, byte[] connectionDataBytes, byte[] hostConnectionDataBytes = null, bool isSecure = false)
Parameters
Shutdown()
Declaration
public override void Shutdown()
StartClient()
Declaration
public override bool StartClient()
Returns
StartServer()
Declaration
public override bool StartServer()
Returns