docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct NetworkPacketReceiver

    The NetworkPacketReceiver is an interface for handling received packets, needed by the INetworkInterface It either can be used in two main scenarios:

    1. Your API requires a pointer to memory that you own. Then you should use AllocateMemory(ref int), write to the memory and then AppendPacket(IntPtr, ref NetworkInterfaceEndPoint, int, AppendPacketMode) with NoCopyNeeded. You don't need to deallocate the memory
    2. Your API gives you a pointer that you don't own. In this case you should use AppendPacket(IntPtr, ref NetworkInterfaceEndPoint, int, AppendPacketMode) with None (default)
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Networking.Transport
    Assembly: solution.dll
    Syntax
    public struct NetworkPacketReceiver

    Properties

    Name Description
    LastUpdateTime

    Gets the value of the last update time.

    ReceiveErrorCode

    Sets the value of the receive error code

    Methods

    Name Description
    AllocateMemory(ref int)

    Calls NetworkDriver's AllocateMemory(ref int)

    AppendPacket(IntPtr, ref NetworkInterfaceEndPoint, int, AppendPacketMode)

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

    IsAddressUsed(NetworkInterfaceEndPoint)

    Check if an address is currently associated with a valid connection. This is mostly useful to keep interface internal lists of connections in sync with the correct state.

    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)