39 Client(
const std::string& ip,
int port);
47 void runOnce(
const int & timeout_ms = -1);
65 virtual const char*
what()
const throw()
67 return "Server disconnected";
74 std::unordered_map<uint64_t, std::chrono::time_point<std::chrono::high_resolution_clock>>
m_pings;
78 std::shared_ptr<Socket> m_client_socket;
86 void emptyOutgoingPackets();
88 void sendPacket(std::shared_ptr<IPacket> packet);
Definition: Client.hpp:62
ServerDisconnected()
Definition: Client.hpp:64
virtual const char * what() const
Definition: Client.hpp:65
The Client side interface with the network module.
Definition: Client.hpp:37
void send(const sendInfo &info)
Definition: Client.cpp:91
Client(Client &&other)=delete
flags
Definition: Client.hpp:50
@ ASYNC
Definition: Client.hpp:51
size_t getQueueSize() const
Definition: Client.cpp:116
std::unordered_map< uint64_t, std::chrono::time_point< std::chrono::high_resolution_clock > > m_pings
Definition: Client.hpp:74
Client & operator=(Client &&other)=delete
void runOnce(const int &timeout_ms=-1)
Definition: Client.cpp:15
Client(const Client &other)=delete
~Client()
Definition: Client.cpp:11
Client & operator=(const Client &other)=delete
std::shared_ptr< IPacket > popPacket()
Definition: Client.cpp:111
a bufferised and thread safe RAII wrapper for a socket representing a connection.
Definition: Connection.hpp:29
Definition: PacketFactory.hpp:8
static PacketFactory & GetInstance()
Get a ref to the singleton instance of the PacketFactory.
Definition: PacketFactory.cpp:110
Definition: Poller.hpp:13
Definition: Client.hpp:55
std::shared_ptr< IPacket > packet
Definition: Client.hpp:56
uint8_t flags
Definition: Client.hpp:57