working commit

This commit is contained in:
2026-04-23 14:53:39 +02:00
parent fa1c3ce9e2
commit cf45872d91
12 changed files with 1786 additions and 26 deletions
+8 -5
View File
@@ -8,13 +8,16 @@
class TCPClient {
private:
int sock;
int family;
public:
TCPClient();
std::expected<void, std::string> conn(std::string address, const int port);
std::expected<int, std::string> writeBytes(std::span<const std::byte> payload);
std::expected<int, std::string> writeBytes(std::string payload);
std::expected<int, std::string> readBytes(std::vector<std::byte>* buffer);
std::expected<int, std::string> readBytes(std::vector<uint8_t>* buffer);
std::expected<void, std::string> Connect(std::string address, const int port);
std::expected<int, std::string> Write(std::span<const std::byte> payload);
std::expected<int, std::string> Write(std::string payload);
std::expected<int, std::string> Read(std::vector<std::byte>* buffer);
std::expected<int, std::string> Read(std::vector<uint8_t>* buffer);
~TCPClient() {
close(sock);