Struct NetworkPacketReceiver
The NetworkPacketReceiver is an interface for handling received packets, needed by the INetworkInterface It either can be used in two main scenarios:
- Your API requires a pointer to memory that you own. Then you should use AllocateMemory(ref int), write to the memory and then AppendPacket(IntPtr, ref NetworkInterfaceEndPoint, int, AppendPacketMode) with NoCopyNeeded. You don't need to deallocate the memory
- Your API gives you a pointer that you don't own. In this case you should use AppendPacket(IntPtr, ref NetworkInterfaceEndPoint, int, AppendPacketMode) with None (default)
Inherited Members
Namespace: Unity.Networking.Transport
Assembly: solution.dll
Syntax
public struct NetworkPacketReceiver
Properties
Name | Description |
---|---|
LastUpdateTime | Gets the value of the last update time. |
ReceiveErrorCode | Sets the value of the receive error code |
Methods
Name | Description |
---|---|
AllocateMemory(ref int) | Calls NetworkDriver's AllocateMemory(ref int) |
AppendPacket(IntPtr, ref NetworkInterfaceEndPoint, int, AppendPacketMode) | When data is received this function should be called to pass it inside NetworkDriver |
IsAddressUsed(NetworkInterfaceEndPoint) | Check if an address is currently associated with a valid connection. This is mostly useful to keep interface internal lists of connections in sync with the correct state. |