1
2
3
4
5
6 #ifndef CMAJOR_BUILD_SOCKET_CLIENT_INCLUDED
7 #define CMAJOR_BUILD_SOCKET_CLIENT_INCLUDED
8 #include <cmajor/build/BuildClient.hpp>
9 #include <cmajor/build/Host.hpp>
10 #include <cmajor/build/SocketConnection.hpp>
11
12 namespace cmajor { namespace build {
13
14 class SocketClient : public Host
15 {
16 public:
17 SocketClient(Log* log_, const std::string& serverName_);
18 const std::string& Name() const override;
19 void Run();
20 void Exit() override;
21 BuildClient* GetClient() const { return buildClient.get(); }
22 Connection* GetConnection() const { return connection.get(); }
23 private:
24 Log* log;
25 std::string name;
26 std::string serverName;
27 TcpSocket socket;
28 std::unique_ptr<SocketConnection> connection;
29 std::unique_ptr<BuildClient> buildClient;
30 };
31
32 } }
33
34 #endif // CMAJOR_BUILD_SOCKET_CLIENT_INCLUDED