Class that represents a connection between the server and a client.
Definition: client_connection.h:37
struct sockaddr_in m_clientAddress
Definition: client_connection.h:42
int getClientPort() const
Gets the clients port.
Definition: client_connection.cc:76
int m_clientPort
Definition: client_connection.h:40
std::atomic< bool > m_isConnected
Definition: client_connection.h:39
void setClientName(const std::string &name)
Sets the clients name.
Definition: client_connection.cc:72
Server * server
Definition: client_connection.h:45
bool isConnected()
Gets the clients connection status.
Definition: client_connection.cc:87
std::string m_clientName
Definition: client_connection.h:43
void sendMessage(const std::string &message)
Sends a message to the client.
Definition: client_connection.cc:57
std::string getClientName() const
Gets the clients name.
Definition: client_connection.cc:68
std::string getClientAddress() const
Gets the clients address.
Definition: client_connection.cc:21
int m_clientSocket
Definition: client_connection.h:41
int getSocketFd() const
Gets the clients socket FD.
Definition: client_connection.cc:80
bool acceptClient(int listeningSocket)
Accepts a client on the listening socket.
Definition: client_connection.cc:36
~ClientConnection()
Destructs a ClientConnection object.
Definition: client_connection.cc:32
Class that represents the central server that connects to multiple clients.
Definition: server.h:39