Struct NetworkPacketReceiver | Unity Transport | 0.3.1-preview.4
docs.unity3d.com
    Show / Hide Table of Contents

    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
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023