Optimized Request and Response classes.

This commit is contained in:
2025-06-01 22:16:32 -07:00
parent 135f855309
commit 73f7ec1a8d
20 changed files with 877 additions and 231 deletions

View File

@@ -24,9 +24,9 @@ namespace ehs
bool connected;
public:
static const UInt_16 HTTPS_Port = 443;
static const UInt_16 HTTP_Port = 80;
static const UInt_16 MaxHeaderSize = 8192;
static constexpr UInt_16 HTTPS_Port = 443;
static constexpr UInt_16 HTTP_Port = 80;
static constexpr UInt_16 MaxHeaderSize = 8192;
virtual ~BaseTCP() = default;
@@ -55,7 +55,7 @@ namespace ehs
/// @param [in] address The ip address to bind to.
/// @param [in] port The port to bind to.
/// @note Used for servers.
virtual void Bind(const Str_8& address, UInt_16 port) = 0;
virtual void Bind(Str_8 address, const UInt_16 &port) = 0;
/// Listens for new incoming connections.
/// @note Used for servers.
@@ -63,13 +63,13 @@ namespace ehs
/// Accepts the new incoming connection.
/// @note Used for servers.
virtual BaseTCP* Accept() = 0;
virtual BaseTCP *Accept() = 0;
/// Connects to a server at the specified address and port.
/// @param [in] address The ip address to connect to.
/// @param [in] port The port to connect to.
/// @note Used for clients.
virtual void Connect(const Str_8& address, UInt_16 port) = 0;
virtual void Connect(Str_8 address, const UInt_16 &port) = 0;
/// Sends data to the connected endpoint.
/// @param [in] buffer The data to send to the endpoint.