working commit

This commit is contained in:
2026-04-23 12:28:36 +02:00
parent 04ad3a724b
commit fa1c3ce9e2
5 changed files with 181 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
#include <expected>
#include <string>
#include <vector>
#include <span>
#include <iostream>
class TCPClient {
private:
int sock;
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);
~TCPClient() {
close(sock);
}
};