Tracks current TCP connections and allows fast lookups by socket fd and connection identifier.
More...
#include <TcpConnectionSet.h>
Inherits AzNetworking::IConnectionSet.
|
using | ConnectionIdMap = AZStd::unordered_map< ConnectionId, AZStd::unique_ptr< TcpConnection > > |
|
using | SocketFdMap = AZStd::unordered_map< SocketFd, TcpConnection * > |
|
using | ConnectionVisitor = AZStd::function< void(IConnection &)> |
|
Tracks current TCP connections and allows fast lookups by socket fd and connection identifier.
◆ AddConnection()
bool AzNetworking::TcpConnectionSet::AddConnection |
( |
AZStd::unique_ptr< TcpConnection > |
connection | ) |
|
Adds a new connection to this connection list instance.
- Parameters
-
connection | pointer to the connection instance to add |
- Returns
- boolean true on success
◆ DeleteConnection() [1/2]
bool AzNetworking::TcpConnectionSet::DeleteConnection |
( |
ConnectionId |
connectionId | ) |
|
|
overridevirtual |
Deletes a connection from this connection list instance by connection identifier.
- Parameters
-
connectionId | connection identifier of the connection to delete |
- Returns
- boolean true on success
Implements AzNetworking::IConnectionSet.
◆ DeleteConnection() [2/2]
bool AzNetworking::TcpConnectionSet::DeleteConnection |
( |
SocketFd |
socketFd | ) |
|
Deletes a connection from this connection list instance by socket fd.
- Parameters
-
socketFD | socket file descriptor of the connection to delete |
- Returns
- boolean true on success
◆ GetActiveConnectionCount()
uint32_t AzNetworking::TcpConnectionSet::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::TcpConnectionSet::GetConnection |
( |
ConnectionId |
connectionId | ) |
const |
|
overridevirtual |
Retrieves a connection from this connection set by connection identifier.
- Parameters
-
connectionId | connection identifier of the connection to retrieve |
- Returns
- pointer to the requested connection instance on success, nullptr on failure
Implements AzNetworking::IConnectionSet.
◆ GetConnection() [2/2]
TcpConnection * AzNetworking::TcpConnectionSet::GetConnection |
( |
SocketFd |
socketFd | ) |
const |
Retrieves a connection from this connection list instance by socket fd.
- Parameters
-
socketFD | socket file descriptor of the connection to retrieve |
- Returns
- pointer to the requested connection instance on success, nullptr on failure
◆ GetConnectionCount()
uint32_t AzNetworking::TcpConnectionSet::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::TcpConnectionSet::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.
◆ GetSocketFdMap()
const SocketFdMap & AzNetworking::TcpConnectionSet::GetSocketFdMap |
( |
| ) |
const |
Returns the set of SocketFds that should be bound to this connection list instance.
- Returns
- the set of SocketFds that should be bound to this connection list instance
◆ VisitConnections()
void AzNetworking::TcpConnectionSet::VisitConnections |
( |
const ConnectionVisitor & |
visitor | ) |
|
|
overridevirtual |
The documentation for this class was generated from the following file:
- Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpConnectionSet.h