Interface INetworkPacketReceiver
The INetworkPacketReceiver is an interface for handling received packets, needed by the INetworkInterface
Namespace: Unity.Networking.Transport
Syntax
public interface INetworkPacketReceiver
Properties
ReceiveCount
Declaration
int ReceiveCount { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
ReceiveErrorCode
Declaration
int ReceiveErrorCode { set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
AppendPacket(NetworkEndPoint, UdpCHeader, Int32)
AppendPacket is where we parse the data from the network into easy to handle events.
Declaration
int AppendPacket(NetworkEndPoint address, UdpCHeader header, int dataLen)
Parameters
Type | Name | Description |
---|---|---|
NetworkEndPoint | 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
bool DynamicDataStreamSize()
Returns
Type | Description |
---|---|
Boolean | True if its dynamically resizing the DataStreamWriter |
GetDataStream()
Get the datastream associated with this Receiver.
Declaration
DataStreamWriter GetDataStream()
Returns
Type | Description |
---|---|
DataStreamWriter | Returns a DataStreamWriter |