diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-06-15 20:29:10 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-06-15 20:29:10 +0000 |
commit | 874c398ad9e185cca26011317a2f7ecf2623d214 (patch) | |
tree | e444c1632ecde2d83889683fb88eeba200e1e18b /win/inspircd_namedpipe.cpp | |
parent | 97ab97c6fbb5776d3b920dd26745997f59388927 (diff) |
IPC now provides feedback via the named pipe, right now the data is just the server name
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9912 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'win/inspircd_namedpipe.cpp')
-rw-r--r-- | win/inspircd_namedpipe.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/win/inspircd_namedpipe.cpp b/win/inspircd_namedpipe.cpp index 5f0c328df..9a960e4c3 100644 --- a/win/inspircd_namedpipe.cpp +++ b/win/inspircd_namedpipe.cpp @@ -22,15 +22,15 @@ void IPCThread::Run() 1000, // client time-out
NULL); // no security attribute
- printf("*** After CreateNamedPipe *** \n");
+ printf("*** After CreateNamedPipe *** \n");
- if (Pipe == INVALID_HANDLE_VALUE)
- {
- printf("*** IPC failure creating named pipe: %s\n", dlerror());
- return;
- }
+ if (Pipe == INVALID_HANDLE_VALUE)
+ {
+ printf("*** IPC failure creating named pipe: %s\n", dlerror());
+ return;
+ }
- printf("*** After check, exit flag=%d *** \n", GetExitFlag());
+ printf("*** After check, exit flag=%d *** \n", GetExitFlag());
printf("*** Loop *** \n");
Connected = ConnectNamedPipe(Pipe, NULL) ? TRUE : (GetLastError() == ERROR_PIPE_CONNECTED);
@@ -57,6 +57,18 @@ void IPCThread::Run() continue;
}
+ std::stringstream status;
+ DWORD Written = 0;
+ ServerInstance->Threads->Mutex(true);
+
+ status << "name " << ServerInstance->Config->ServerName << std::endl;
+ status << "END" << std::endl;
+
+ ServerInstance->Threads->Mutex(false);
+
+ /* This is a blocking call and will succeed, so long as the client doesnt disconnect */
+ Success = WriteFile(Pipe, status.str().data(), status.str().length(), &Written, NULL);
+
FlushFileBuffers(Pipe);
DisconnectNamedPipe(Pipe);
}
|