Open 3D Engine AzNetworking API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
Helper class defining an encrypted DTLS endpoint. Note that multiple connections are multiplexed onto a single DTLS socket. More...
#include <DtlsEndpoint.h>
Public Types | |
enum class | ConnectResult { Failed , Pending , Complete } |
enum class | HandshakeState { None , Connecting , Accepting , Complete , Failed } |
Public Member Functions | |
ConnectResult | Connect (const DtlsSocket &socket, const IpAddress &address, UdpPacketEncodingBuffer &outDtlsData) |
ConnectResult | Accept (const DtlsSocket &socket, const IpAddress &address) |
bool | IsConnecting () const |
ConnectResult | ProcessHandshakeData (UdpConnection &connection, const UdpPacketEncodingBuffer &dtlsData) |
const uint8_t * | DecodePacket (UdpConnection &connection, const uint8_t *encryptedData, int32_t encryptedSize, uint8_t *outDecodedData, int32_t &outDecodedSize) |
Friends | |
class | DtlsSocket |
Helper class defining an encrypted DTLS endpoint. Note that multiple connections are multiplexed onto a single DTLS socket.
ConnectResult AzNetworking::DtlsEndpoint::Accept | ( | const DtlsSocket & | socket, |
const IpAddress & | address | ||
) |
Accepts a connection from the remote encrypted endpoint.
socket | the dtls socket being used for data transmission |
address | the address of the remote endpoint connecting to us |
ConnectResult AzNetworking::DtlsEndpoint::Connect | ( | const DtlsSocket & | socket, |
const IpAddress & | address, | ||
UdpPacketEncodingBuffer & | outDtlsData | ||
) |
Opens a connection with the remote encrypted endpoint.
socket | the dtls socket being used for data transmission |
address | the address of the remote endpoint being connected to |
outDtlsData | data buffer to store the dtls handshake packet |
const uint8_t* AzNetworking::DtlsEndpoint::DecodePacket | ( | UdpConnection & | connection, |
const uint8_t * | encryptedData, | ||
int32_t | encryptedSize, | ||
uint8_t * | outDecodedData, | ||
int32_t & | outDecodedSize | ||
) |
If the endpoint has encryption enabled, this will decrypt the transmitted data and return the result.
connection | the UDP connection being used for data transmission |
encryptedData | the potentially encrypted data received from the socket |
encryptedSize | the size of the received raw data |
outDecodedData | an appropriately sized output buffer to store decrypted data |
outDecodedSize | the size of the output buffer |
bool AzNetworking::DtlsEndpoint::IsConnecting | ( | ) | const |
Returns whether or not the endpoint is still negotiating the dtls handshake.
ConnectResult AzNetworking::DtlsEndpoint::ProcessHandshakeData | ( | UdpConnection & | connection, |
const UdpPacketEncodingBuffer & | dtlsData | ||
) |
Attempts to complete the dtls handshake and establish an encrypted connection.
connection | the UDP connection being used for data transmission |
dtlsData | data buffer containing dtls handshake packet |