Network interface class to abstract client/server and protocol concerns from application code.
More...
#include <INetworkInterface.h>
Inherited by AzNetworking::TcpNetworkInterface, and AzNetworking::UdpNetworkInterface.
Network interface class to abstract client/server and protocol concerns from application code.
INetworkInterface provides an abstract API capable of receiving and opening IConnection objects, sending IPacket objects with optional reliability, and determining the delivery status of packets that have been sent unreliably (delivery of reliable packets is guaranteed as long as the associated connection remains open). INetworkInterface must be provided an IConnectionListener instance that outlives the INetworkInterface itself. The INetworkInterface also creates and manages the IConnectionSet, which tracks all open connections bound to the interface. INetworkInterface also provides GetMetrics functions which can be used to fetch a struct detailing a variety of metrics relating to send and receive rates for both packets and bytes in addition to the effect of features on those rates (such as packet size reduction due to compression.)
◆ Connect()
virtual ConnectionId AzNetworking::INetworkInterface::Connect |
( |
const IpAddress & |
remoteAddress, |
|
|
uint16_t |
localPort = 0 |
|
) |
| |
|
pure virtual |
Opens a new connection to the provided address.
- Parameters
-
remoteAddress | the IpAddress of the remote process to open a connection to |
localPort | the local port number to open a socket on to initiate the connection, 0 binds to any available port |
- Returns
- the connectionId of the new connection, or InvalidConnectionId if the operation failed
Implemented in AzNetworking::TcpNetworkInterface, and AzNetworking::UdpNetworkInterface.
◆ Disconnect()
virtual bool AzNetworking::INetworkInterface::Disconnect |
( |
ConnectionId |
connectionId, |
|
|
DisconnectReason |
reason |
|
) |
| |
|
pure virtual |
◆ GetConnectionListener()
◆ GetConnectionSet()
virtual IConnectionSet & AzNetworking::INetworkInterface::GetConnectionSet |
( |
| ) |
|
|
pure virtual |
◆ GetMetrics() [1/2]
Non-const access to the metrics tracked by this network interface.
- Returns
- reference to the metrics tracked by this network interface
◆ GetMetrics() [2/2]
Const access to the metrics tracked by this network interface.
- Returns
- const reference to the metrics tracked by this network interface
◆ GetName()
virtual AZ::Name AzNetworking::INetworkInterface::GetName |
( |
| ) |
const |
|
pure virtual |
◆ GetPort()
virtual uint16_t AzNetworking::INetworkInterface::GetPort |
( |
| ) |
const |
|
pure virtual |
◆ GetTimeoutMs()
virtual AZ::TimeMs AzNetworking::INetworkInterface::GetTimeoutMs |
( |
| ) |
const |
|
pure virtual |
◆ GetTrustZone()
virtual TrustZone AzNetworking::INetworkInterface::GetTrustZone |
( |
| ) |
const |
|
pure virtual |
◆ GetType()
virtual ProtocolType AzNetworking::INetworkInterface::GetType |
( |
| ) |
const |
|
pure virtual |
◆ IsEncrypted()
virtual bool AzNetworking::INetworkInterface::IsEncrypted |
( |
| ) |
const |
|
pure virtual |
◆ IsOpen()
virtual bool AzNetworking::INetworkInterface::IsOpen |
( |
| ) |
const |
|
pure virtual |
◆ Listen()
virtual bool AzNetworking::INetworkInterface::Listen |
( |
uint16_t |
port | ) |
|
|
pure virtual |
Opens the network interface to allow it to accept new incoming connections.
- Parameters
-
port | the listen port number this network interface will potentially bind to, 0 if it's a don't care |
- Returns
- boolean true if the operation was successful, false if it failed
Implemented in AzNetworking::TcpNetworkInterface, and AzNetworking::UdpNetworkInterface.
◆ SendReliablePacket()
virtual bool AzNetworking::INetworkInterface::SendReliablePacket |
( |
ConnectionId |
connectionId, |
|
|
const IPacket & |
packet |
|
) |
| |
|
pure virtual |
A helper function that transmits a packet on this connection reliably. Note that a packetId is not returned here, since retransmits may cause the packetId to change
- Parameters
-
connectionId | identifier of the connection to send to |
packet | packet to transmit |
- Returns
- boolean true if the packet was transmitted (not an indication of delivery)
Implemented in AzNetworking::TcpNetworkInterface, and AzNetworking::UdpNetworkInterface.
◆ SendUnreliablePacket()
virtual PacketId AzNetworking::INetworkInterface::SendUnreliablePacket |
( |
ConnectionId |
connectionId, |
|
|
const IPacket & |
packet |
|
) |
| |
|
pure virtual |
◆ SetTimeoutMs()
virtual void AzNetworking::INetworkInterface::SetTimeoutMs |
( |
AZ::TimeMs |
timeoutMs | ) |
|
|
pure virtual |
◆ StopListening()
virtual bool AzNetworking::INetworkInterface::StopListening |
( |
| ) |
|
|
pure virtual |
◆ Update()
virtual void AzNetworking::INetworkInterface::Update |
( |
| ) |
|
|
pure virtual |
◆ WasPacketAcked()
virtual bool AzNetworking::INetworkInterface::WasPacketAcked |
( |
ConnectionId |
connectionId, |
|
|
PacketId |
packetId |
|
) |
| |
|
pure virtual |
Returns true if the given packet id was confirmed acknowledged by the remote endpoint, false otherwise.
- Parameters
-
connectionId | identifier of the connection to send to |
packetId | the packet id of the packet to confirm acknowledgment of |
- Returns
- boolean true if the packet is confirmed acknowledged, false if the packet number is out of range, lost, or still pending acknowledgment
Implemented in AzNetworking::TcpNetworkInterface, and AzNetworking::UdpNetworkInterface.
The documentation for this class was generated from the following file:
- Code/Framework/AzNetworking/AzNetworking/Framework/INetworkInterface.h