Class NetworkTransport
The generic transport class all Netcode for GameObjects network transport implementations derive from. Use this class to add a custom transport. for an example of how a transport is integrated
Inherited Members
Namespace: Unity.Netcode
Assembly: solution.dll
Syntax
public abstract class NetworkTransport : MonoBehaviour
Properties
Name | Description |
---|---|
IsSupported | Gets a value indicating whether this NetworkTransport is supported in the current runtime context This is used by multiplex adapters |
ServerClientId | A constant |
Methods
Name | Description |
---|---|
DisconnectLocalClient() | Disconnects the local client from the server |
DisconnectRemoteClient(ulong) | Disconnects a client from the server |
GetCurrentRtt(ulong) | Gets the round trip time for a specific client. This method is optional |
Initialize(NetworkManager) | Initializes the transport |
InvokeOnTransportEvent(NetworkEvent, ulong, ArraySegment<byte>, float) | Invokes the OnTransportEvent. Invokation has to occur on the Unity thread in the Update loop. |
PollEvent(out ulong, out ArraySegment<byte>, out float) | Polls for incoming events, with an extra output parameter to report the precise time the event was received. |
Send(ulong, ArraySegment<byte>, NetworkDelivery) | Send a payload to the specified clientId, data and networkDelivery. |
Shutdown() | Shuts down the transport |
StartClient() | Connects client to the server |
StartServer() | Starts to listening for incoming clients |
Events
Name | Description |
---|---|
OnTransportEvent | Occurs when the transport has a new transport network event. Can be used to make an event based transport instead of a poll based. Invocation has to occur on the Unity thread in the Update loop. |