docs.unity3d.com
    Show / Hide Table of Contents

    Struct PacketsQueue

    A queue of packets with an internal pool of preallocated packet buffers.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Networking.Transport
    Syntax
    public struct PacketsQueue : IDisposable

    Properties

    Capacity

    Total capacity of the queue.

    Declaration
    public readonly int Capacity { get; }
    Property Value
    Type Description
    Int32

    Capacity in number of packets.

    Count

    Number of packets currently in the queue.

    Declaration
    public readonly int Count { get; }
    Property Value
    Type Description
    Int32

    Count in number of packets.

    IsCreated

    Whether the queue has been created or not.

    Declaration
    public readonly bool IsCreated { get; }
    Property Value
    Type Description
    Boolean

    True if created, false otherwise.

    Item[Int32]

    Gets the packet processor for the packet at the given index.

    Declaration
    public readonly PacketProcessor this[int packetIndex] { get; }
    Parameters
    Type Name Description
    Int32 packetIndex

    Index of the packet in the queue.

    Property Value
    Type Description
    PacketProcessor

    Packet processor for the packet at the provided index.

    Exceptions
    Type Condition
    IndexOutOfRangeException

    If the index is not valid.

    Methods

    Clear()

    Removes and releases all the packets in the queue.

    Declaration
    public void Clear()

    Dispose()

    Declaration
    public void Dispose()
    Implements
    IDisposable.Dispose()

    EnqueuePacket(out PacketProcessor)

    Acquires a new packet buffer from the packets pool if there are any available.

    Declaration
    public bool EnqueuePacket(out PacketProcessor packetProcessor)
    Parameters
    Type Name Description
    PacketProcessor packetProcessor

    Packet processor for the new packet.

    Returns
    Type Description
    Boolean

    True if a new packet was enqueued, false otherwise.

    EnqueuePackets(ref PacketsQueue)

    Copies all the packets from the given queue into this one. Note that no error is raised if not all packets could be copied. It is the responsibility of the caller to ensure that the queue can fit all the packets from the given queue.

    Declaration
    public void EnqueuePackets(ref PacketsQueue originQueue)
    Parameters
    Type Name Description
    PacketsQueue originQueue

    Queue that contains the packets to enqueue.

    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