Open 3D Engine AzNetworking API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzNetworking::IConnectionSet Class Referenceabstract

interface class for managing a set of connections. More...

#include <IConnectionSet.h>

Inherited by AzNetworking::TcpConnectionSet, and AzNetworking::UdpConnectionSet.

Public Types

using ConnectionVisitor = AZStd::function< void(IConnection &)>
 

Public Member Functions

virtual void VisitConnections (const ConnectionVisitor &visitor)=0
 
virtual bool DeleteConnection (ConnectionId connectionId)=0
 
virtual IConnectionGetConnection (ConnectionId connectionId) const =0
 
virtual ConnectionId GetNextConnectionId ()=0
 
virtual uint32_t GetConnectionCount () const =0
 
virtual uint32_t GetActiveConnectionCount () const =0
 

Detailed Description

interface class for managing a set of connections.

IConnectionSet defines a simple interface for working with an abstract set of IConnections bound to an INetworkInterface. Generally users of AzNetworking will not have reason to interact directly with the IConnectionSet, as its interface is completely wrapped by INetworkInterface.

Member Function Documentation

◆ DeleteConnection()

virtual bool AzNetworking::IConnectionSet::DeleteConnection ( ConnectionId  connectionId)
pure virtual

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

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

Implemented in AzNetworking::TcpConnectionSet, and AzNetworking::UdpConnectionSet.

◆ GetActiveConnectionCount()

virtual uint32_t AzNetworking::IConnectionSet::GetActiveConnectionCount ( ) const
pure virtual

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

Implemented in AzNetworking::TcpConnectionSet, and AzNetworking::UdpConnectionSet.

◆ GetConnection()

virtual IConnection * AzNetworking::IConnectionSet::GetConnection ( ConnectionId  connectionId) const
pure virtual

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

Implemented in AzNetworking::TcpConnectionSet, and AzNetworking::UdpConnectionSet.

◆ GetConnectionCount()

virtual uint32_t AzNetworking::IConnectionSet::GetConnectionCount ( ) const
pure virtual

Returns the current total connection count for this connection set

Returns
the current total connection count for this connection set

Implemented in AzNetworking::TcpConnectionSet, and AzNetworking::UdpConnectionSet.

◆ GetNextConnectionId()

virtual ConnectionId AzNetworking::IConnectionSet::GetNextConnectionId ( )
pure virtual

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

Implemented in AzNetworking::TcpConnectionSet, and AzNetworking::UdpConnectionSet.

◆ VisitConnections()

virtual void AzNetworking::IConnectionSet::VisitConnections ( const ConnectionVisitor &  visitor)
pure virtual

Will visit each active connection in the connection set and invoke the provided connection visitor.

Parameters
visitorthe visitor to visit each connection with

Implemented in AzNetworking::TcpConnectionSet, and AzNetworking::UdpConnectionSet.


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