Class UnityTransport
The Netcode for GameObjects NetworkTransport for UnityTransport. Note: This is highly recommended to use over UNet.
Implements
Inherited Members
Namespace: Unity.Netcode.Transports.UTP
Assembly: solution.dll
Syntax
[AddComponentMenu("Netcode/Unity Transport")]
public class UnityTransport : NetworkTransport, INetworkStreamDriverConstructor
Fields
Name | Description |
---|---|
Connection |
The connection (address) data for this Unity |
Debug |
Can be used to simulate poor network conditions such as:
|
Initial |
The default maximum (receive) packet queue size |
Initial |
The default maximum payload size |
Initial |
The default maximum send queue size |
s_Driver |
The global INetwork |
Properties
Name | Description |
---|---|
Connect |
Timeout in milliseconds indicating how long we will wait until we send a new connection attempt. |
Disconnect |
Inactivity timeout after which a connection will be disconnected. |
Driver |
Returns either the global INetwork |
Heartbeat |
Timeout in milliseconds after which a heartbeat is sent if there is no activity. |
Max |
The maximum amount of connection attempts we will try before disconnecting. |
Max |
The maximum amount of packets that can be in the internal send/receive queues. |
Max |
The maximum size of an unreliable payload that can be handled by the transport. |
Max |
The maximum size in bytes of the transport send queue. |
Protocol | The current ProtocolType used by the transport |
Server |
The client id used to represent the server. |
Methods
Name | Description |
---|---|
Create |
Creates the internal NetworkDriver |
Disconnect |
Disconnects the local client from the remote |
Disconnect |
Disconnects a remote client from the server |
Get |
Gets the current RTT for a specific client |
Initialize(Network |
Initializes the transport |
Poll |
Polls for incoming events, with an extra output parameter to report the precise time the event was received. |
Send(ulong, Array |
Send a payload to the specified clientId, data and networkDelivery. |
Set |
Set the relay server data for the host. |
Set |
Set the client parameters for encryption. |
Set |
Sets IP and Port information. This will be ignored if using the Unity Relay and you should call Set |
Set |
Sets IP and Port information. This will be ignored if using the Unity Relay and you should call Set |
Set |
Set the parameters for the debug simulator. |
Set |
Set the relay server data for the host. |
Set |
Set the relay server data for the server. |
Set |
Set the relay server data (using the lower-level Unity Transport data structure). |
Set |
Set the server parameters for encryption. |
Shutdown() | Shuts down the transport |
Start |
Connects client to the server Note: When this method returns false it could mean:
|
Start |
Starts to listening for incoming clients Note: When this method returns false it could mean:
|