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

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

#include <TlsSocket.h>

Inherits AzNetworking::TcpSocket.

Public Member Functions

 TlsSocket (TrustZone trustZone)
 
 TlsSocket (SocketFd socketFd, TrustZone trustZone)
 
bool IsEncrypted () const override
 
TcpSocketCloneAndTakeOwnership () override
 
bool Listen (uint16_t port) override
 
bool Connect (const IpAddress &address, uint16_t localPort) override
 
void Close () override
 Closes an open socket.
 
- Public Member Functions inherited from AzNetworking::TcpSocket
 TcpSocket (SocketFd socketFd)
 
virtual TcpSocketCloneAndTakeOwnership ()
 
virtual bool IsEncrypted () const
 
virtual bool Listen (uint16_t port)
 
virtual bool Connect (const IpAddress &address, uint16_t localPort)
 
virtual void Close ()
 Closes an open socket.
 
bool IsOpen () const
 
void SetSocketFd (SocketFd socketFd)
 
SocketFd GetSocketFd () const
 
int32_t Send (const uint8_t *data, uint32_t size) const
 
int32_t Receive (uint8_t *outData, uint32_t size) const
 

Protected Attributes

SSL_CTX * m_sslContext
 
SSL * m_sslSocket
 
TrustZone m_trustZone
 
- Protected Attributes inherited from AzNetworking::TcpSocket
SocketFd m_socketFd
 

Detailed Description

wrapper class for managing encrypted Tcp sockets.

Constructor & Destructor Documentation

◆ TlsSocket()

AzNetworking::TlsSocket::TlsSocket ( SocketFd  socketFd,
TrustZone  trustZone 
)

Construct with an existing socket file descriptor.

Parameters
socketFdexisting socket file descriptor, this TlsSocket instance will assume ownership
trustZonefor encrypted connections, the level of trust we associate with this connection (internal or external)

Member Function Documentation

◆ CloneAndTakeOwnership()

TcpSocket * AzNetworking::TlsSocket::CloneAndTakeOwnership ( )
overridevirtual

Creates a new socket instance, transferring all ownership from the current instance to the new instance.

Returns
new socket instance

Reimplemented from AzNetworking::TcpSocket.

◆ Close()

void AzNetworking::TlsSocket::Close ( )
overridevirtual

Closes an open socket.

Reimplemented from AzNetworking::TcpSocket.

◆ Connect()

bool AzNetworking::TlsSocket::Connect ( const IpAddress address,
uint16_t  localPort 
)
overridevirtual

Opens the TCP socket and connects to the requested remote address.

Parameters
addressthe remote endpoint to connect to
localPortthe local port to open a connection from, 0 binds to any available port
Returns
boolean true on success

Reimplemented from AzNetworking::TcpSocket.

◆ IsEncrypted()

bool AzNetworking::TlsSocket::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::TcpSocket.

◆ Listen()

bool AzNetworking::TlsSocket::Listen ( uint16_t  port)
overridevirtual

Opens the TCP socket and binds it in listen mode.

Parameters
portthe port number to open the TCP socket and begin listening on, 0 will bind to any available port
Returns
boolean true on success

Reimplemented from AzNetworking::TcpSocket.


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