#include <BaseTCP.h>
◆ ~BaseTCP()
virtual ehs::BaseTCP::~BaseTCP |
( |
| ) |
|
|
virtualdefault |
◆ BaseTCP() [1/4]
ehs::BaseTCP::BaseTCP |
( |
| ) |
|
Initializes the socket with the defaults.
◆ BaseTCP() [2/4]
ehs::BaseTCP::BaseTCP |
( |
IP | ip | ) |
|
Properly initializes the socket.
- Parameters
-
[in] | type | The ip version to initialize the socket with. |
◆ BaseTCP() [3/4]
ehs::BaseTCP::BaseTCP |
( |
BaseTCP && | tcp | ) |
|
|
noexcept |
◆ BaseTCP() [4/4]
ehs::BaseTCP::BaseTCP |
( |
const BaseTCP & | tcp | ) |
|
◆ Accept()
virtual BaseTCP * ehs::BaseTCP::Accept |
( |
| ) |
|
|
pure virtual |
◆ Bind()
virtual void ehs::BaseTCP::Bind |
( |
const Str_8 & | address, |
|
|
UInt_16 | port ) |
|
pure virtual |
Binds to socket to a specified address and port.
- Parameters
-
[in] | address | The ip address to bind to. |
[in] | port | The port to bind to. |
- Note
- Used for servers.
Implemented in ehs::SSL, ehs::TCP, and ehs::TCP.
◆ Connect()
virtual void ehs::BaseTCP::Connect |
( |
const Str_8 & | address, |
|
|
UInt_16 | port ) |
|
pure virtual |
Connects to a server at the specified address and port.
- Parameters
-
[in] | address | The ip address to connect to. |
[in] | port | The port to connect to. |
- Note
- Used for clients.
Implemented in ehs::SSL, ehs::TCP, and ehs::TCP.
◆ GetAddressType()
IP ehs::BaseTCP::GetAddressType |
( |
| ) |
const |
Retrieves the sockets ip version.
- Returns
- The ip version.
◆ GetLocalAddress()
Str_8 ehs::BaseTCP::GetLocalAddress |
( |
| ) |
const |
Retrieves the bound ip address.
- Returns
- The ip address.
◆ GetLocalPort()
unsigned short ehs::BaseTCP::GetLocalPort |
( |
| ) |
const |
Retrieves the bound port.
- Returns
- The port.
◆ GetRemoteAddress()
Str_8 ehs::BaseTCP::GetRemoteAddress |
( |
| ) |
const |
Retrieves the ip address of the connected endpoint.
- Returns
- The ip address.
◆ GetRemotePort()
unsigned short ehs::BaseTCP::GetRemotePort |
( |
| ) |
const |
Retrieves the port of the connected endpoint.
- Returns
- The port.
◆ Initialize()
virtual void ehs::BaseTCP::Initialize |
( |
| ) |
|
|
pure virtual |
◆ IsBlocking()
virtual bool ehs::BaseTCP::IsBlocking |
( |
| ) |
const |
|
pure virtual |
Retrieves whether or not when receiving data blocks the thread.
- Returns
- The result.
Implemented in ehs::TCP, and ehs::TCP.
◆ IsBound()
bool ehs::BaseTCP::IsBound |
( |
| ) |
const |
Retrieves whether of not this socket is bound to an ip address and port.
- Returns
- The result.
◆ IsConnected()
bool ehs::BaseTCP::IsConnected |
( |
| ) |
const |
Retrieves whether or not this socket is connected to an endpoint.
- Returns
- The result.
◆ IsConnection()
bool ehs::BaseTCP::IsConnection |
( |
| ) |
const |
Retrieves whether or not this socket is connected to a client endpoint.
- Returns
- The result.
◆ IsIPv6Only()
virtual bool ehs::BaseTCP::IsIPv6Only |
( |
| ) |
const |
|
pure virtual |
◆ IsListening()
bool ehs::BaseTCP::IsListening |
( |
| ) |
const |
Retrieves whether or not this socket is listening for incoming connections.
- Returns
- The result.
◆ IsValid()
virtual bool ehs::BaseTCP::IsValid |
( |
| ) |
const |
|
pure virtual |
Retrieves whether or not this socket was initialized.
- Returns
- The result.
Implemented in ehs::TCP, and ehs::TCP.
◆ Listen()
virtual void ehs::BaseTCP::Listen |
( |
| ) |
|
|
pure virtual |
Listens for new incoming connections.
- Note
- Used for servers.
Implemented in ehs::TCP, and ehs::TCP.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Receive()
virtual UInt_64 ehs::BaseTCP::Receive |
( |
Byte * | buffer, |
|
|
UInt_32 | size ) |
|
pure virtual |
Receives data from the connected endpoint.
- Parameters
-
[out] | buffer | The incoming data from the endpoint. |
[in] | size | The max size of the buffer in bytes to store the data. |
- Returns
- The size of the incoming data in bytes.
Implemented in ehs::SSL, ehs::TCP, and ehs::TCP.
◆ RecvReq()
Receives a HTTP request from the connected endpoint.
- Returns
- The request received.
◆ RecvRes()
Receives a HTTP response from the connected endpoint.
- Returns
- The response received.
◆ Release()
virtual void ehs::BaseTCP::Release |
( |
| ) |
|
|
pure virtual |
◆ Send()
virtual UInt_64 ehs::BaseTCP::Send |
( |
const Byte * | buffer, |
|
|
UInt_32 | size ) |
|
pure virtual |
Sends data to the connected endpoint.
- Parameters
-
[in] | buffer | The data to send to the endpoint. |
[in] | size | The size in bytes of data being sent. |
Implemented in ehs::SSL, ehs::TCP, and ehs::TCP.
◆ SendReq()
void ehs::BaseTCP::SendReq |
( |
Request & | req | ) |
|
Sends a HTTP request to the connected endpoint.
- Parameters
-
[in] | req | The request to send. |
◆ SendRes()
void ehs::BaseTCP::SendRes |
( |
const Response & | res | ) |
|
Sends a HTTP response to the connected endpoint.
- Parameters
-
[in] | res | The response to send. |
◆ SendStr()
void ehs::BaseTCP::SendStr |
( |
const Str_8 & | str | ) |
|
Sends a string to the connected endpoint.
- Parameters
-
[in] | str | The string to send to the endpoint. |
◆ SetBlocking()
virtual void ehs::BaseTCP::SetBlocking |
( |
bool | blocking | ) |
|
|
pure virtual |
Sets whether or not the socket blocks the thread when receiving data.
- Parameters
-
[in] | blocking | Whether or not to block. |
Implemented in ehs::TCP, and ehs::TCP.
◆ SetIPv6Only()
virtual void ehs::BaseTCP::SetIPv6Only |
( |
bool | value | ) |
|
|
pure virtual |
◆ bound
◆ connected
bool ehs::BaseTCP::connected |
|
protected |
◆ connection
bool ehs::BaseTCP::connection |
|
protected |
◆ HTTP_Port
const UInt_16 ehs::BaseTCP::HTTP_Port = 80 |
|
static |
◆ HTTPS_Port
const UInt_16 ehs::BaseTCP::HTTPS_Port = 443 |
|
static |
◆ ip
◆ listening
bool ehs::BaseTCP::listening |
|
protected |
◆ localAddr
Str_8 ehs::BaseTCP::localAddr |
|
protected |
◆ localPort
◆ MaxHeaderSize
const UInt_16 ehs::BaseTCP::MaxHeaderSize = 8192 |
|
static |
◆ remoteAddr
Str_8 ehs::BaseTCP::remoteAddr |
|
protected |
◆ remoteHostName
Str_8 ehs::BaseTCP::remoteHostName |
|
protected |
◆ remotePort
The documentation for this class was generated from the following files: