1234567891011121314151617181920212223242526272829303132 |
- #ifndef CLIENT_H
- #define CLIENT_H
- #include <string>
- #include <thread>
- #include "client/network/IClientListener.h"
- using namespace std;
- class Client
- {
- 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
|