summaryrefslogtreecommitdiff
path: root/src/socketengines/pipeengine_win32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengines/pipeengine_win32.cpp')
-rw-r--r--src/socketengines/pipeengine_win32.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/socketengines/pipeengine_win32.cpp b/src/socketengines/pipeengine_win32.cpp
deleted file mode 100644
index f34472870..000000000
--- a/src/socketengines/pipeengine_win32.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "services.h"
-
-Pipe::Pipe() : Socket(-1)
-{
- sockaddrs localhost;
-
- localhost.pton(AF_INET, "127.0.0.1");
-
- int cfd = socket(AF_INET, SOCK_STREAM, 0), lfd = socket(AF_INET, SOCK_STREAM, 0);
- if (cfd == -1)
- throw CoreException("Error accepting new socket for Pipe");
-
- if (bind(lfd, &localhost.sa, localhost.size()) == -1)
- throw CoreException("Error accepting new socket for Pipe");
- if (listen(lfd, 1) == -1)
- throw CoreException("Error accepting new socket for Pipe");
-
- sockaddrs lfd_addr;
- socklen_t sz = sizeof(lfd_addr);
- getsockname(lfd, &lfd_addr.sa, &sz);
-
- if (connect(cfd, &lfd_addr.sa, lfd_addr.size()))
- throw CoreException("Error accepting new socket for Pipe");
- CloseSocket(lfd);
-
- this->WritePipe = cfd;
-
- SocketEngine::AddSocket(this);
-}
-
-Pipe::~Pipe()
-{
- CloseSocket(this->WritePipe);
-}
-
-bool Pipe::ProcessRead()
-{
- char dummy[512];
- while (recv(this->GetFD(), dummy, 512, 0) == 512);
- this->OnNotify();
- return true;
-}
-
-void Pipe::Notify()
-{
- const char dummy = '*';
- send(this->WritePipe, &dummy, 1, 0);
-}
-
-void Pipe::OnNotify()
-{
-}
-