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::DtlsSocket Class Referencefinal

wrapper class for managing encrypted Udp sockets. More...

#include <DtlsSocket.h>

Inherits AzNetworking::UdpSocket.

Public Member Functions

bool IsEncrypted () const override
 
DtlsEndpoint::ConnectResult ConnectDtlsEndpoint (DtlsEndpoint &dtlsEndpoint, const IpAddress &address, UdpPacketEncodingBuffer &outDtlsData) const override
 
DtlsEndpoint::ConnectResult AcceptDtlsEndpoint (DtlsEndpoint &dtlsEndpoint, const IpAddress &address) const override
 
bool Open (uint16_t port, UdpSocket::CanAcceptConnections canAccept, TrustZone trustZone) override
 
void Close () override
 Closes an open socket.
 
- Public Member Functions inherited from AzNetworking::UdpSocket
virtual bool IsEncrypted () const
 
virtual DtlsEndpoint::ConnectResult ConnectDtlsEndpoint (DtlsEndpoint &dtlsEndpoint, const IpAddress &address, UdpPacketEncodingBuffer &outDtlsData) const
 
virtual DtlsEndpoint::ConnectResult AcceptDtlsEndpoint (DtlsEndpoint &dtlsEndpoint, const IpAddress &address) const
 
virtual bool Open (uint16_t port, CanAcceptConnections canAccept, TrustZone trustZone)
 
virtual void Close ()
 Closes an open socket.
 
bool IsOpen () const
 
int32_t Send (const IpAddress &address, const uint8_t *data, uint32_t size, bool encrypt, DtlsEndpoint &dtlsEndpoint, const ConnectionQuality &connectionQuality) const
 
int32_t Receive (IpAddress &outAddress, uint8_t *outData, uint32_t size) const
 
SocketFd GetSocketFd () const
 
uint32_t GetSentPackets () const
 
uint32_t GetSentBytes () const
 
uint32_t GetSentPacketsEncrypted () const
 
uint32_t GetSentBytesEncryptionInflation () const
 
uint32_t GetRecvPackets () const
 
uint32_t GetRecvBytes () const
 

Friends

class DtlsEndpoint
 

Additional Inherited Members

- Public Types inherited from AzNetworking::UdpSocket
enum class  CanAcceptConnections { False , True }
 
- Protected Attributes inherited from AzNetworking::UdpSocket
uint32_t m_sentPacketsEncrypted = 0
 
uint32_t m_sentBytesEncryptionInflation = 0
 

Detailed Description

wrapper class for managing encrypted Udp sockets.

Member Function Documentation

◆ AcceptDtlsEndpoint()

DtlsEndpoint::ConnectResult AzNetworking::DtlsSocket::AcceptDtlsEndpoint ( DtlsEndpoint dtlsEndpoint,
const IpAddress address 
) const
overridevirtual

Accepts an encryption socket wrapper.

Parameters
dtlsEndpointthe encryption wrapper instance to create a connection over
addressthe IP address of the endpoint to connect to
Returns
a connect result specifying whether the connection is still pending, failed, or complete

Reimplemented from AzNetworking::UdpSocket.

◆ Close()

void AzNetworking::DtlsSocket::Close ( )
overridevirtual

Closes an open socket.

Reimplemented from AzNetworking::UdpSocket.

◆ ConnectDtlsEndpoint()

DtlsEndpoint::ConnectResult AzNetworking::DtlsSocket::ConnectDtlsEndpoint ( DtlsEndpoint dtlsEndpoint,
const IpAddress address,
UdpPacketEncodingBuffer outDtlsData 
) const
overridevirtual

Creates an encryption socket wrapper.

Parameters
dtlsEndpointthe encryption wrapper instance to create a connection over
addressthe IP address of the endpoint to connect to
outDtlsDatadata buffer to store the dtls handshake packet
Returns
a connect result specifying whether the connection is still pending, failed, or complete

Reimplemented from AzNetworking::UdpSocket.

◆ IsEncrypted()

bool AzNetworking::DtlsSocket::IsEncrypted ( ) const
overridevirtual

Returns true if this is an encrypted socket, false if not.

Returns
boolean true if this is an encrypted socket, false if not

Reimplemented from AzNetworking::UdpSocket.

◆ Open()

bool AzNetworking::DtlsSocket::Open ( uint16_t  port,
UdpSocket::CanAcceptConnections  canAccept,
TrustZone  trustZone 
)
overridevirtual

Opens the UDP socket on the given port.

Parameters
portthe port number to open the UDP socket on, 0 will bind to any available port
canAcceptif true, the socket will be opened in a way that allows accepting incoming connections
trustZonefor encrypted connections, the level of trust we associate with this connection (internal or external)
Returns
boolean true on success

Reimplemented from AzNetworking::UdpSocket.


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