Class Network

Class Documentation

class Network

Public Functions

Network(int port, std::string hostname, std::shared_ptr<API> &data)

Construct a new Network object.

Parameters:
  • port – Contain the port of the server.

  • hostname – Contain the hostname of the server.

~Network()
void Run()

Run the network of the client.

void SendMessage(const std::string &msg)

Send a message to the server.

Parameters:

msg – Contain the message to send.

std::string ReceiveMessage() const

Receive a message from the server.

Returns:

Return as a std::string the message sent by the server.

void RequestStop()

Request to stop the network thread.