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.
Public Types | Public Member Functions | List of all members
AzNetworking::UdpConnectionSet Class Referencefinal

Tracks current UDP endpoints and allows fast lookups by connection identifier and remote address. More...

#include <UdpConnectionSet.h>

Inherits AzNetworking::IConnectionSet.

Public Types

using ConnectionIdMap = AZStd::unordered_map< ConnectionId, AZStd::unique_ptr< UdpConnection > >
 
using RemoteAddressMap = AZStd::unordered_map< IpAddress, UdpConnection * >
 
- Public Types inherited from AzNetworking::IConnectionSet
using ConnectionVisitor = AZStd::function< void(IConnection &)>
 

Public Member Functions

bool AddConnection (AZStd::unique_ptr< UdpConnection > connection)
 
bool DeleteConnection (const IpAddress &address)
 
UdpConnectionGetConnection (const IpAddress &address) const
 
void VisitConnections (const ConnectionVisitor &visitor) override
 
bool DeleteConnection (ConnectionId connectionId) override
 
IConnectionGetConnection (ConnectionId connectionId) const override
 
ConnectionId GetNextConnectionId () override
 
uint32_t GetConnectionCount () const override
 
uint32_t GetActiveConnectionCount () const override
 

Detailed Description

Tracks current UDP endpoints and allows fast lookups by connection identifier and remote address.

Member Function Documentation

◆ AddConnection()

bool AzNetworking::UdpConnectionSet::AddConnection ( AZStd::unique_ptr< UdpConnection connection)

Adds a new connection to this connection list instance.

Parameters
connectionpointer to the connection instance to add
Returns
boolean true on success

◆ DeleteConnection() [1/2]

bool AzNetworking::UdpConnectionSet::DeleteConnection ( ConnectionId  connectionId)
overridevirtual

Deletes a connection from this connection list instance by connection identifier.

Parameters
connectionIdconnection identifier of the connection to delete
Returns
boolean true on success

Implements AzNetworking::IConnectionSet.

◆ DeleteConnection() [2/2]

bool AzNetworking::UdpConnectionSet::DeleteConnection ( const IpAddress address)

Deletes a connection from this connection list instance by endpoint remote address.

Parameters
addressaddress of the remote endpoint to delete
Returns
boolean true on success

◆ GetActiveConnectionCount()

uint32_t AzNetworking::UdpConnectionSet::GetActiveConnectionCount ( ) const
overridevirtual

Returns the current total count of connections not pending disconnect for this connection set

Returns
the current total count of connections not pending disconnect for this connection set

Implements AzNetworking::IConnectionSet.

◆ GetConnection() [1/2]

IConnection* AzNetworking::UdpConnectionSet::GetConnection ( ConnectionId  connectionId) const
overridevirtual

Retrieves a connection from this connection set by connection identifier.

Parameters
connectionIdconnection identifier of the connection to retrieve
Returns
pointer to the requested connection instance on success, nullptr on failure

Implements AzNetworking::IConnectionSet.

◆ GetConnection() [2/2]

UdpConnection* AzNetworking::UdpConnectionSet::GetConnection ( const IpAddress address) const

Retrieves a connection from this connection list instance by endpoint remote address

Parameters
addressaddress of the remote endpoint of the connection to retrieve
Returns
pointer to the requested connection instance on success, nullptr on failure

◆ GetConnectionCount()

uint32_t AzNetworking::UdpConnectionSet::GetConnectionCount ( ) const
overridevirtual

Returns the current total connection count for this connection set

Returns
the current total connection count for this connection set

Implements AzNetworking::IConnectionSet.

◆ GetNextConnectionId()

ConnectionId AzNetworking::UdpConnectionSet::GetNextConnectionId ( )
overridevirtual

Returns the next valid connection identifier for this connection list instance.

Returns
a valid connection identifier to give a new connection instance, or InvalidConnectionId on failure

Implements AzNetworking::IConnectionSet.

◆ VisitConnections()

void AzNetworking::UdpConnectionSet::VisitConnections ( const ConnectionVisitor &  visitor)
overridevirtual

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