summaryrefslogtreecommitdiff
path: root/Source/cmPipeConnection.h
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2017-03-24 21:38:52 -0600
committerJustin Berger <j.david.berger@gmail.com>2017-07-10 18:11:27 -0600
commitd4f5d35ca491ede92003b26a7d0eb06aea3a2bbb (patch)
tree90f665b7e1611c47ab8eaa3f069e9572d3df58fb /Source/cmPipeConnection.h
parent5acbf08bff643ec6779464c840bfe2f02a4e65ae (diff)
downloadcmake-d4f5d35ca491ede92003b26a7d0eb06aea3a2bbb.tar.gz
server: Refactor to make the event loop owned by server object
Diffstat (limited to 'Source/cmPipeConnection.h')
-rw-r--r--Source/cmPipeConnection.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/cmPipeConnection.h b/Source/cmPipeConnection.h
new file mode 100644
index 0000000000..3d3d52cb59
--- /dev/null
+++ b/Source/cmPipeConnection.h
@@ -0,0 +1,28 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#pragma once
+
+#include "cmConnection.h"
+
+#include "cm_uv.h"
+
+#include <string>
+
+class cmPipeConnection : public cmConnection
+{
+public:
+ cmPipeConnection(const std::string& name,
+ cmConnectionBufferStrategy* bufferStrategy = nullptr);
+
+ bool OnServeStart(std::string* pString) override;
+
+ bool OnServerShuttingDown() override;
+
+ void Connect(uv_stream_t* server) override;
+
+private:
+ const std::string PipeName;
+ uv_pipe_t* ServerPipe = nullptr;
+ uv_pipe_t* ClientPipe = nullptr;
+};