EHS
|
A wrapper class for the transmission control protocol socket. More...
#include <TCP_BSD.h>
Public Member Functions | |
~TCP () override | |
Frees any native handles. More... | |
TCP () | |
Default members initialization. More... | |
TCP (IP IP) | |
TCP (TCP &&tcp) noexcept | |
TCP (const TCP &tcp) | |
TCP & | operator= (TCP &&tcp) noexcept |
TCP & | operator= (const TCP &tcp) |
void | Initialize () override |
Explicitly initialize the socket. More... | |
void | Release () override |
Frees native handles and uninitializes them. More... | |
void | Bind (const Str_8 &address, UInt_16 port) override |
void | Listen () override |
Listens for incoming connections. Used for servers or PtP. More... | |
TCP * | Accept () 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. More... | |
TCP () | |
Default members initialization. More... | |
TCP (IP IP) | |
TCP (TCP &&tcp) noexcept | |
TCP (const TCP &tcp) | |
TCP & | operator= (TCP &&tcp) noexcept |
TCP & | operator= (const TCP &tcp) |
void | Initialize () override |
Explicitly initialize the socket. More... | |
void | Release () override |
Frees native handles and uninitializes them. More... | |
void | Bind (const Str_8 &address, UInt_16 port) override |
void | Listen () override |
Listens for incoming connections. Used for servers or PtP. More... | |
TCP * | Accept () 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 |
![]() | |
virtual | ~BaseTCP ()=default |
BaseTCP () | |
Initializes the socket with the defaults. More... | |
BaseTCP (IP ip) | |
BaseTCP (BaseTCP &&tcp) noexcept | |
BaseTCP (const BaseTCP &tcp) | |
BaseTCP & | operator= (BaseTCP &&tcp) noexcept |
BaseTCP & | operator= (const BaseTCP &tcp) |
virtual void | Initialize ()=0 |
Explicitly initialize the socket. More... | |
virtual void | Release ()=0 |
Explicitly release resources before it falls off the stack. More... | |
virtual void | Bind (const Str_8 &address, UInt_16 port)=0 |
virtual void | Listen ()=0 |
virtual BaseTCP * | Accept ()=0 |
virtual void | Connect (const Str_8 &address, UInt_16 port)=0 |
virtual UInt_64 | Send (const Byte *buffer, UInt_32 size)=0 |
virtual UInt_64 | Receive (Byte *buffer, UInt_32 size)=0 |
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 |
virtual void | SetBlocking (bool blocking)=0 |
virtual bool | IsBlocking () const =0 |
virtual void | SetIPv6Only (bool value)=0 |
virtual bool | IsIPv6Only () const =0 |
virtual bool | IsValid () const =0 |
Protected Attributes | |
Socket | hdl |
![]() | |
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 |
Additional Inherited Members | |
![]() | |
static const UInt_16 | HTTPS_Port = 443 |
static const UInt_16 | HTTP_Port = 80 |
static const UInt_16 | MaxHeaderSize = 8192 |
A wrapper class for the transmission control protocol socket.
|
override |
Frees any native handles.
ehs::TCP::TCP | ( | ) |
Default members initialization.
ehs::TCP::TCP | ( | IP | IP | ) |
|
noexcept |
ehs::TCP::TCP | ( | const TCP & | tcp | ) |
|
override |
Frees any native handles.
ehs::TCP::TCP | ( | ) |
Default members initialization.
ehs::TCP::TCP | ( | IP | IP | ) |
|
noexcept |
ehs::TCP::TCP | ( | const TCP & | tcp | ) |
|
overridevirtual |
Accepts an incoming connection. Used for servers or PtP.
Implements ehs::BaseTCP.
|
overridevirtual |
Accepts an incoming connection. Used for servers or PtP.
Implements ehs::BaseTCP.
Binds the UDP socket to a local address and port.
[in] | address | The local IPv4 or IPv6 address to bind to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device. |
[in] | port | The port to bind to. |
Implements ehs::BaseTCP.
Binds the UDP socket to a local address and port.
[in] | address | The local IPv4 or IPv6 address to bind to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device. |
[in] | port | The port to bind to. |
Implements ehs::BaseTCP.
Connects to a TCP Socket that listens for incoming connections. Used for clients or PtP.
address | The address of the listening TCP socket. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device. |
port | The port of the listening TCP socket. |
Implements ehs::BaseTCP.
Connects to a TCP Socket that listens for incoming connections. Used for clients or PtP.
address | The address of the listening TCP socket. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device. |
port | The port of the listening TCP socket. |
Implements ehs::BaseTCP.
|
overridevirtual |
Explicitly initialize the socket.
Implements ehs::BaseTCP.
|
overridevirtual |
Explicitly initialize the socket.
Implements ehs::BaseTCP.
|
overridevirtual |
Retrieves whether or not this socket will block when receiving data.
Implements ehs::BaseTCP.
|
overridevirtual |
Retrieves whether or not this socket will block when receiving data.
Implements ehs::BaseTCP.
|
overridevirtual |
Implements ehs::BaseTCP.
|
overridevirtual |
Implements ehs::BaseTCP.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Listens for incoming connections. Used for servers or PtP.
Implements ehs::BaseTCP.
|
overridevirtual |
Listens for incoming connections. Used for servers or PtP.
Implements ehs::BaseTCP.
Receives data in a C-style array with raw functionality. Meaning no internal help outside of native functions besides error checking.
[out] | buffer | The C-style array to receive with. |
[in] | size | The size of the given C-style array. |
Implements ehs::BaseTCP.
Receives data in a C-style array with raw functionality. Meaning no internal help outside of native functions besides error checking.
[out] | buffer | The C-style array to receive with. |
[in] | size | The size of the given C-style array. |
Implements ehs::BaseTCP.
|
overridevirtual |
Frees native handles and uninitializes them.
Implements ehs::BaseTCP.
|
overridevirtual |
Frees native handles and uninitializes them.
Implements ehs::BaseTCP.
Sends data in a C-style array with raw functionality. Meaning no internal help outside of native functions besides error checking.
[in] | buffer | The C-style array to send. |
[in] | size | The size of the given C-style array. |
Implements ehs::BaseTCP.
Sends data in a C-style array with raw functionality. Meaning no internal help outside of native functions besides error checking.
[in] | buffer | The C-style array to send. |
[in] | size | The size of the given C-style array. |
Implements ehs::BaseTCP.
|
overridevirtual |
Sets whether or not receiving data blocks the next task.
[in] | blocking | Whether or not to block. |
Implements ehs::BaseTCP.
|
overridevirtual |
Sets whether or not receiving data blocks the next task.
[in] | blocking | Whether or not to block. |
Implements ehs::BaseTCP.
|
overridevirtual |
Implements ehs::BaseTCP.
|
overridevirtual |
Implements ehs::BaseTCP.
|
protected |