docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method AppendPacket

    AppendPacket(IntPtr, ref NetworkInterfaceEndPoint, int, AppendPacketMode)

    When data is received this function should be called to pass it inside NetworkDriver

    Declaration
    public bool AppendPacket(IntPtr data, ref NetworkInterfaceEndPoint address, int dataLen, NetworkPacketReceiver.AppendPacketMode mode = AppendPacketMode.None)
    Parameters
    Type Name Description
    IntPtr data

    Pointer to the data. If it is pointer to data that was received with AllocateMemory(ref int) make sure mode is NoCopyNeeded>

    NetworkInterfaceEndPoint address

    Address where data was received from

    int dataLen

    Length of data in bytes

    NetworkPacketReceiver.AppendPacketMode mode

    Extra flags, like NoCopyNeeded that means - no copy is needed, data is already in NetworkDriver's data stream

    Returns
    Type Description
    bool

    True if no errors

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)