Struct NetworkPacketReceiver
The NetworkPacketReceiver is an interface for handling received packets, needed by the INetworkInterface
Namespace: Unity.Networking.Transport
Syntax
public struct NetworkPacketReceiver
Properties
ReceiveCount
Declaration
public int ReceiveCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
ReceiveErrorCode
Declaration
public int ReceiveErrorCode { set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
AppendPacket(NetworkInterfaceEndPoint, UdpCHeader, Int32)
AppendPacket is where we parse the data from the network into easy to handle events.
Declaration
public int AppendPacket(NetworkInterfaceEndPoint address, UdpCHeader header, int dataLen)
Parameters
Type | Name | Description |
---|---|---|
NetworkInterfaceEndPoint | address | The address of the endpoint we received data from. |
UdpCHeader | header | The header data indicating what type of packet it is. UdpCHeader for more information. |
Int32 | dataLen | The size of the payload, if any. |
Returns
Type | Description |
---|---|
Int32 |
DynamicDataStreamSize()
Check if the DataStreamWriter uses dynamic allocations to automatically resize the buffers or not.
Declaration
public bool DynamicDataStreamSize()
Returns
Type | Description |
---|---|
Boolean | True if its dynamically resizing the DataStreamWriter |
GetDataStream()
Get the datastream associated with this Receiver.
Declaration
public NativeList<byte> GetDataStream()
Returns
Type | Description |
---|---|
NativeList<Byte> | Returns a NativeList of bytes |
GetDataStreamSize()
Declaration
public int GetDataStreamSize()
Returns
Type | Description |
---|---|
Int32 |