working commit
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user