Interface INetworkPacketReceiver | Unity Transport | 0.2.4-preview.0
docs.unity3d.com
    Show / Hide Table of Contents

    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

    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