6 #include <netinet/in.h>
8 #include <sys/socket.h>
15 #include <unordered_map>
17 #define MAX_READ_BUFFER 16000
19 #include "../message/message.hpp"
65 std::vector<Message> _msgs;
74 void _networkError(std::string&& errorMessage);
75 void _receiveMessage();
76 bool _isConnected()
const;
80 Client(
const std::string& address,
const size_t& port);
82 void connect(
const std::string& address,
const size_t& port);
86 const std::function<
void(
const Message& msg)>& action);
Basic TCP client class using POSIX sockets and select() for network communication.
void connect(const std::string &address, const size_t &port)
void send(const Message &message)
void defineAction(const Message::Type &messageType, const std::function< void(const Message &msg)> &action)
Class representing a structured message for network communication.