EHS
Loading...
Searching...
No Matches
ehs::SSL Class Reference

A class for handling the HTTP(S) TCP socket layer. More...

#include <SSL.h>

Inheritance diagram for ehs::SSL:
ehs::TCP ehs::BaseTCP ehs::BaseTCP

Public Member Functions

 ~SSL () override
 
 SSL ()
 
 SSL (const IP type)
 
 SSL (TCP &&tcp) noexcept
 
 SSL (const TCP &tcp)
 
 SSL (const SSL &ssl)
 
SSLoperator= (const SSL &ssl)
 
void Initialize () override
 Explicitly initialize the socket.
 
void Release () override
 Explicitly release resources before it falls off the stack.
 
void Bind (const Str_8 &address, unsigned short port) override
 
SSLAccept () override
 
void Connect (const Str_8 &address, const UInt_16 port) override
 
UInt_64 Send (const Byte *const buffer, const UInt_32 size) override
 
UInt_64 Receive (Byte *const buffer, const UInt_32 size) override
 
void UseCertificate (const Byte *data, const UInt_64 size)
 
void UsePrivateKey (const Byte *data, const UInt_64 size)
 
bool IsValid ()
 
- Public Member Functions inherited from ehs::TCP
 ~TCP () override
 Frees any native handles.
 
 TCP ()
 Default members initialization.
 
 TCP (IP IP)
 
 TCP (TCP &&tcp) noexcept
 
 TCP (const TCP &tcp)
 
TCPoperator= (TCP &&tcp) noexcept
 
TCPoperator= (const TCP &tcp)
 
void Initialize () override
 Explicitly initialize the socket.
 
void Release () override
 Frees native handles and uninitializes them.
 
void Bind (const Str_8 &address, UInt_16 port) override
 
void Listen () override
 Listens for incoming connections. Used for servers or PtP.
 
TCPAccept () override
 
void Connect (const Str_8 &address, UInt_16 port) override
 
UInt_64 Send (const Byte *buffer, UInt_32 size) override
 
UInt_64 Receive (Byte *buffer, UInt_32 size) override
 
void SetBlocking (bool blocking) override
 
bool IsBlocking () const override
 
void SetIPv6Only (bool value) override
 
bool IsIPv6Only () const override
 
bool IsValid () const override
 
 ~TCP () override
 Frees any native handles.
 
 TCP ()
 Default members initialization.
 
 TCP (IP IP)
 
 TCP (TCP &&tcp) noexcept
 
 TCP (const TCP &tcp)
 
TCPoperator= (TCP &&tcp) noexcept
 
TCPoperator= (const TCP &tcp)
 
void Initialize () override
 Explicitly initialize the socket.
 
void Release () override
 Frees native handles and uninitializes them.
 
void Bind (const Str_8 &address, UInt_16 port) override
 
void Listen () override
 Listens for incoming connections. Used for servers or PtP.
 
TCPAccept () override
 
void Connect (const Str_8 &address, UInt_16 port) override
 
UInt_64 Send (const Byte *buffer, UInt_32 size) override
 
UInt_64 Receive (Byte *buffer, UInt_32 size) override
 
void SetBlocking (bool blocking) override
 
bool IsBlocking () const override
 
void SetIPv6Only (bool value) override
 
bool IsIPv6Only () const override
 
bool IsValid () const override
 
- Public Member Functions inherited from ehs::BaseTCP
virtual ~BaseTCP ()=default
 
 BaseTCP ()
 Initializes the socket with the defaults.
 
 BaseTCP (IP ip)
 
 BaseTCP (BaseTCP &&tcp) noexcept
 
 BaseTCP (const BaseTCP &tcp)
 
BaseTCPoperator= (BaseTCP &&tcp) noexcept
 
BaseTCPoperator= (const BaseTCP &tcp)
 
void SendStr (const Str_8 &str)
 
void SendRes (const Response &res)
 
void SendReq (Request &req)
 
Response RecvRes ()
 
Request RecvReq ()
 
IP GetAddressType () const
 
Str_8 GetLocalAddress () const
 
unsigned short GetLocalPort () const
 
Str_8 GetRemoteAddress () const
 
UInt_16 GetRemotePort () const
 
bool IsConnection () const
 
bool IsBound () const
 
bool IsListening () const
 
bool IsConnected () const
 

Additional Inherited Members

- Static Public Attributes inherited from ehs::BaseTCP
static const UInt_16 HTTPS_Port = 443
 
static const UInt_16 HTTP_Port = 80
 
static const UInt_16 MaxHeaderSize = 8192
 
- Protected Attributes inherited from ehs::TCP
Socket hdl
 
- Protected Attributes inherited from ehs::BaseTCP
IP ip
 
Str_8 localAddr
 
UInt_16 localPort
 
Str_8 remoteHostName
 
Str_8 remoteAddr
 
UInt_16 remotePort
 
bool connection
 
bool bound
 
bool listening
 
bool connected
 

Detailed Description

A class for handling the HTTP(S) TCP socket layer.

Constructor & Destructor Documentation

◆ ~SSL()

ehs::SSL::~SSL ( )
override

◆ SSL() [1/5]

ehs::SSL::SSL ( )

◆ SSL() [2/5]

ehs::SSL::SSL ( const IP type)

◆ SSL() [3/5]

ehs::SSL::SSL ( TCP && tcp)
noexcept

◆ SSL() [4/5]

ehs::SSL::SSL ( const TCP & tcp)

◆ SSL() [5/5]

ehs::SSL::SSL ( const SSL & ssl)

Member Function Documentation

◆ Accept()

SSL * ehs::SSL::Accept ( )
overridevirtual

Accepts the new incoming connection.

Note
Used for servers.

Implements ehs::BaseTCP.

◆ Bind()

void ehs::SSL::Bind ( const Str_8 & address,
unsigned short port )
overridevirtual

Binds to socket to a specified address and port.

Parameters
[in]addressThe ip address to bind to.
[in]portThe port to bind to.
Note
Used for servers.

Implements ehs::BaseTCP.

◆ Connect()

void ehs::SSL::Connect ( const Str_8 & address,
const UInt_16 port )
overridevirtual

Connects to a server at the specified address and port.

Parameters
[in]addressThe ip address to connect to.
[in]portThe port to connect to.
Note
Used for clients.

Implements ehs::BaseTCP.

◆ Initialize()

void ehs::SSL::Initialize ( )
overridevirtual

Explicitly initialize the socket.

Implements ehs::BaseTCP.

◆ IsValid()

bool ehs::SSL::IsValid ( )

◆ operator=()

SSL & ehs::SSL::operator= ( const SSL & ssl)

◆ Receive()

UInt_64 ehs::SSL::Receive ( Byte *const buffer,
const UInt_32 size )
overridevirtual

Receives data from the connected endpoint.

Parameters
[out]bufferThe incoming data from the endpoint.
[in]sizeThe max size of the buffer in bytes to store the data.
Returns
The size of the incoming data in bytes.

Implements ehs::BaseTCP.

◆ Release()

void ehs::SSL::Release ( )
overridevirtual

Explicitly release resources before it falls off the stack.

Implements ehs::BaseTCP.

◆ Send()

UInt_64 ehs::SSL::Send ( const Byte *const buffer,
const UInt_32 size )
overridevirtual

Sends data to the connected endpoint.

Parameters
[in]bufferThe data to send to the endpoint.
[in]sizeThe size in bytes of data being sent.

Implements ehs::BaseTCP.

◆ UseCertificate()

void ehs::SSL::UseCertificate ( const Byte * data,
const UInt_64 size )

◆ UsePrivateKey()

void ehs::SSL::UsePrivateKey ( const Byte * data,
const UInt_64 size )

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