12345678910111213141516171819202122232425262728293031 |
- #ifndef CLIENT_H
- #define CLIENT_H
- #include <string>
- #include <thread>
- #include "client/network/IClientListener.h"
- using namespace std;
- class Client final {
- public:
- Client();
- virtual ~Client();
- bool start(const string& ip, unsigned short port, IClientListener* listener);
- void stop();
- private:
- void listenOnServer();
- int connectionSocket = -1;
- volatile bool shouldRun = false;
- thread serverListenThread;
- IClientListener* clientListener;
- };
- #endif
|