API reference
API reference
Select your platform
No SDKs available
No versions available

Packet Class

Extends IDisposable
This class provides a way to encapsulate and transmit data across a network. It contains methods for reading and writing data, as well as properties for accessing metadata about the packet. See more info about Platform Solutions here.

Constructors

Packet ( packetHandle )
Initializes a new instance of the Packet class with a specified packet handle. The param packetHandle must be a valid handle to a packet created by the underlying native API.
Signature
Oculus.Platform.Packet.Packet(IntPtr packetHandle)
Parameters
packetHandle: IntPtr

Properties

SenderID : UInt64
[Get]
Gets the sender ID of the packet. This value identifies the source of the packet and can be used to track the origin of the data.
Signature
UInt64 Oculus.Platform.Packet.SenderID
Size : ulong
[Get]
Gets the size of the packet in bytes. This value represents the total amount of data contained within the packet.
Signature
ulong Oculus.Platform.Packet.Size

Methods

Dispose ()
This method is called when the Packet is being garbage collected or when it is explicitly disposed of. It is responsible for releasing any unmanaged resources, such as the native packet handle, that are held by the Packet.
Signature
void Oculus.Platform.Packet.Dispose()
Returns
void
ReadBytes ( destination )
Copies all the bytes in the payload into a byte array. This method is used to retrieve the raw data contained within the packet.
Signature
ulong Oculus.Platform.Packet.ReadBytes(byte[] destination)
Parameters
destination: byte []  The destination byte array. This array must be large enough to hold the entire packet payload, which is specified by the Size property.
Returns
ulong  The number of bytes read from the packet. This value will always be equal to the Size property.