Class TransportManager
Communicates with the Transport to send and receive data.
Inheritance
Inherited Members
Namespace: FishNet.Managing.Transporting
Assembly: FishNet.Runtime.dll
Syntax
[DisallowMultipleComponent]
[AddComponentMenu("FishNet/Manager/TransportManager")]
public sealed class TransportManager : MonoBehaviour
Fields
CHANNEL_COUNT
Number of channels supported.
Declaration
public const byte CHANNEL_COUNT = 2
Field Value
Type | Description |
---|---|
System.Byte |
COMPONENT_INDEX_LENGTH
Number of bytes sent for ComponentIndex.
Declaration
public const byte COMPONENT_INDEX_LENGTH = 1
Field Value
Type | Description |
---|---|
System.Byte |
INVALID_MTU
Value to use when a MTU could not be found.
Declaration
public const int INVALID_MTU = -1
Field Value
Type | Description |
---|---|
System.Int32 |
MINIMUM_MTU_RESERVE
MTU reserved for internal use. 1 byte is used to specify channel in packets for transports that do not include channel within their packet header. This is transport dependent.
Declaration
public const int MINIMUM_MTU_RESERVE = 1
Field Value
Type | Description |
---|---|
System.Int32 |
OBJECT_ID_LENGTH
Number of bytes sent for ObjectId.
Declaration
public const byte OBJECT_ID_LENGTH = 2
Field Value
Type | Description |
---|---|
System.Byte |
PACKETID_LENGTH
Number of bytes sent for PacketId.
Declaration
public const byte PACKETID_LENGTH = 2
Field Value
Type | Description |
---|---|
System.Byte |
SPLIT_INDICATOR_LENGTH
Number of bytes required for split data.
Declaration
public const byte SPLIT_INDICATOR_LENGTH = 10
Field Value
Type | Description |
---|---|
System.Byte |
Transport
The current Transport being used.
Declaration
[Tooltip("The current Transport being used.")]
public Transport Transport
Field Value
Type | Description |
---|---|
Transport |
UNPACKED_SIZE_LENGTH
Number of bytes sent for an unpacked size, such as a collection or array size.
Declaration
public const byte UNPACKED_SIZE_LENGTH = 4
Field Value
Type | Description |
---|---|
System.Byte |
UNPACKED_TICK_LENGTH
Number of bytes sent for Tick.
Declaration
public const byte UNPACKED_TICK_LENGTH = 4
Field Value
Type | Description |
---|---|
System.Byte |
Properties
HasIntermediateLayer
Returns if an IntermediateLayer is in use.
Declaration
public bool HasIntermediateLayer { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LatencySimulator
Latency simulation settings.
Declaration
public LatencySimulator LatencySimulator { get; }
Property Value
Type | Description |
---|---|
LatencySimulator |
Methods
GetLowestMTU()
Returns the lowest MTU of all channels. When using multipass this will evaluate all transports within Multipass.
Declaration
public int GetLowestMTU()
Returns
Type | Description |
---|---|
System.Int32 |
GetLowestMTU(Byte)
Returns the lowest MTU for a channel. When using multipass this will evaluate all transports within Multipass.
Declaration
public int GetLowestMTU(byte channel)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | channel |
Returns
Type | Description |
---|---|
System.Int32 |
GetMTU(Byte)
Gets MTU on the current transport for channel.
Declaration
public int GetMTU(byte channel)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | channel | Channel to get MTU of. |
Returns
Type | Description |
---|---|
System.Int32 |
GetMTU(Int32, Byte)
Gets MTU on the transportIndex for channel. This requires use of Multipass.
Declaration
public int GetMTU(int transportIndex, byte channel)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | transportIndex | Index of the transport to get the MTU on. |
System.Byte | channel | Channel to get MTU of. |
Returns
Type | Description |
---|---|
System.Int32 |
GetMTU<T>(Byte)
Gets MTU on the transport type for channel. This requires use of Multipass.
Declaration
public int GetMTU<T>(byte channel)
where T : Transport
Parameters
Type | Name | Description |
---|---|---|
System.Byte | channel | Channel to get MTU of. |
Returns
Type | Description |
---|---|
System.Int32 |
Type Parameters
Name | Description |
---|---|
T | Tyep of transport to use. |
GetMTUReserve()
Returns the current MTU reserve.
Declaration
public int GetMTUReserve()
Returns
Type | Description |
---|---|
System.Int32 |
GetTransport(Int32)
Gets transport on index. Commonly index will be 0 unless using Multipass.
Declaration
public Transport GetTransport(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Returns
Type | Description |
---|---|
Transport |
GetTransport<T>()
Gets transport of type T.
Declaration
public T GetTransport<T>()
where T : Transport
Returns
Type | Description |
---|---|
T | Returns the found transport which is of type T. Returns default of T if not found. |
Type Parameters
Name | Description |
---|---|
T |
IsLocalTransport(Int32, Int32)
Returns IsLocalTransport for the transportId, optionally checking against a connectionId.
Declaration
public bool IsLocalTransport(int transportId, int connectionId = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | transportId | |
System.Int32 | connectionId |
Returns
Type | Description |
---|---|
System.Boolean |
SetMTUReserve(Int32)
Sets a custom value to reserve for the internal buffers. This value is also deducted from transport MTU when using GetMTU methods.
Declaration
public void SetMTUReserve(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | Value to use. |