Open 3D Engine AzNetworking API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
AzNetworking::UdpReaderThread Class Reference

Inherits AzNetworking::TimedThread.

Classes

struct  ReceivedPacket
 

Public Types

using ReceivedPackets = AZStd::fixed_vector< ReceivedPacket, MaxUdpReceivePacketCount >
 

Public Member Functions

bool RegisterSocket (UdpSocket *socket)
 
void UnregisterSocket (UdpSocket *socket)
 
const ReceivedPackets * GetReceivedPackets (UdpSocket *socket) const
 
void SwapBuffers ()
 Should be called immediately before any registered sockets have processed their received packets.
 
uint32_t GetSocketCount () const
 
AZ::TimeMs GetUpdateTimeMs () const
 
- Public Member Functions inherited from AzNetworking::TimedThread
 TimedThread (const char *name, AZ::TimeMs updateRate)
 
void Start ()
 Starts the thread.
 
void Stop ()
 Stops the thread.
 
void Join ()
 Joins the thread.
 
bool IsRunning () const
 

Static Public Attributes

static constexpr uint32_t MaxUdpReceivePacketCount = 1024
 
static constexpr uint32_t MaxUdpReceiveBufferSize = MaxUdpReceivePacketCount * MaxUdpTransmissionUnit
 

Additional Inherited Members

Member Function Documentation

◆ GetReceivedPackets()

const ReceivedPackets* AzNetworking::UdpReaderThread::GetReceivedPackets ( UdpSocket socket) const

Returns the set of all packets consumed off the socket during the last call to ReadDataFromSocket().

Returns
all packets consumed off the socket during the last call to ReadDataFromSocket()

◆ GetSocketCount()

uint32_t AzNetworking::UdpReaderThread::GetSocketCount ( ) const

Returns the number of active sockets bound to this thread.

Returns
the number of active sockets bound to this thread

◆ GetUpdateTimeMs()

AZ::TimeMs AzNetworking::UdpReaderThread::GetUpdateTimeMs ( ) const

Gets the total elapsed time spent updating the background thread in milliseconds

Returns
the total elapsed time spent updating the background thread in milliseconds

◆ RegisterSocket()

bool AzNetworking::UdpReaderThread::RegisterSocket ( UdpSocket socket)

Adds the provided socket to the socket reader for processing.

Parameters
socketpointer to the UdpSocket to read incoming data from
Returns
boolean true on success, false for failure

◆ UnregisterSocket()

void AzNetworking::UdpReaderThread::UnregisterSocket ( UdpSocket socket)

Removes the provided socket from the socket reader for processing.

Parameters
socketpointer to the UdpSocket to read incoming data from

The documentation for this class was generated from the following file: