diff options
author | Justin Berger <j.david.berger@gmail.com> | 2017-02-25 22:06:34 (GMT) |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2017-07-11 00:12:05 (GMT) |
commit | cf0ae55dcb9224b92a95166f17452c56ba5b6213 (patch) | |
tree | 95f53f8e5aee010f5cd4cb90871bac18216d5402 /Source/cmPipeConnection.cxx | |
parent | 5ddfb6a472539c3a01a6f8e6d8fa1cb1013fc4f9 (diff) | |
download | CMake-cf0ae55dcb9224b92a95166f17452c56ba5b6213.zip CMake-cf0ae55dcb9224b92a95166f17452c56ba5b6213.tar.gz CMake-cf0ae55dcb9224b92a95166f17452c56ba5b6213.tar.bz2 |
server: Add support for connections that aren't event based
Diffstat (limited to 'Source/cmPipeConnection.cxx')
-rw-r--r-- | Source/cmPipeConnection.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmPipeConnection.cxx b/Source/cmPipeConnection.cxx index 438719f..cc82438 100644 --- a/Source/cmPipeConnection.cxx +++ b/Source/cmPipeConnection.cxx @@ -7,7 +7,7 @@ cmPipeConnection::cmPipeConnection(const std::string& name, cmConnectionBufferStrategy* bufferStrategy) - : cmConnection(bufferStrategy) + : cmEventBasedConnection(bufferStrategy) , PipeName(name) { } @@ -26,8 +26,7 @@ void cmPipeConnection::Connect(uv_stream_t* server) this->ClientPipe = new uv_pipe_t(); uv_pipe_init(this->Server->GetLoop(), this->ClientPipe, 0); - this->ClientPipe->data = static_cast<cmConnection*>(this); - + this->ClientPipe->data = static_cast<cmEventBasedConnection*>(this); auto client = reinterpret_cast<uv_stream_t*>(this->ClientPipe); if (uv_accept(server, client) != 0) { uv_close(reinterpret_cast<uv_handle_t*>(client), &on_close_delete); @@ -45,7 +44,7 @@ bool cmPipeConnection::OnServeStart(std::string* errorMessage) { this->ServerPipe = new uv_pipe_t(); uv_pipe_init(this->Server->GetLoop(), this->ServerPipe, 0); - this->ServerPipe->data = static_cast<cmConnection*>(this); + this->ServerPipe->data = static_cast<cmEventBasedConnection*>(this); int r; if ((r = uv_pipe_bind(this->ServerPipe, this->PipeName.c_str())) != 0) { @@ -63,7 +62,7 @@ bool cmPipeConnection::OnServeStart(std::string* errorMessage) return cmConnection::OnServeStart(errorMessage); } -bool cmPipeConnection::OnServerShuttingDown() +bool cmPipeConnection::OnConnectionShuttingDown() { if (this->ClientPipe) { uv_close(reinterpret_cast<uv_handle_t*>(this->ClientPipe), @@ -77,5 +76,5 @@ bool cmPipeConnection::OnServerShuttingDown() this->WriteStream = nullptr; this->ReadStream = nullptr; - return cmConnection::OnServerShuttingDown(); + return cmConnection::OnConnectionShuttingDown(); } |