1
2
3
4
5
6 #ifndef CMAJOR_BUILD_SOCKET_CONNECTION_INCLUDED
7 #define CMAJOR_BUILD_SOCKET_CONNECTION_INCLUDED
8 #include <cmajor/build/Connection.hpp>
9 #include <soulng/util/Socket.hpp>
10
11 namespace cmajor { namespace build {
12
13 class Host;
14
15 class SocketConnection : public Connection
16 {
17 public:
18 SocketConnection(Log* log, Host* host_, TcpSocket&& socket_);
19 void DoSend(JsonObject* messageObject) override;
20 std::unique_ptr<JsonObject> DoReceive() override;
21 void DoClose() override;
22 const std::string& GetActor() const override;
23 Host* GetHost() const override { return host; }
24 private:
25 Host* host;
26 TcpSocket socket;
27 };
28
29 } }
30
31 #endif // CMAJOR_BUILD_SOCKET_CONNECTION_INCLUDED