diff options
Diffstat (limited to 'win/inspircd_namedpipe.cpp')
-rw-r--r-- | win/inspircd_namedpipe.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/win/inspircd_namedpipe.cpp b/win/inspircd_namedpipe.cpp index 3f0f47fdf..d51172c05 100644 --- a/win/inspircd_namedpipe.cpp +++ b/win/inspircd_namedpipe.cpp @@ -19,7 +19,7 @@ void IPCThread::Run() {
LPTSTR Pipename = "\\\\.\\pipe\\InspIRCdStatus";
- while (GetExitFlag() == false) + while (GetExitFlag() == false)
{
Pipe = CreateNamedPipe (Pipename,
PIPE_ACCESS_DUPLEX, // read/write access
@@ -123,45 +123,45 @@ void IPCThread::SetResult(int newresult) }
-IPC::IPC(InspIRCd* Srv) : ServerInstance(Srv) -{ - /* The IPC pipe is threaded */ - thread = new IPCThread(Srv); - Srv->Threads->Create(thread); -} - -void IPC::Check() -{ - switch (thread->GetStatus()) - { - case 'N': - /* No-Operation */ - thread->SetResult(0); - thread->ClearStatus(); - break; - case '1': - /* Rehash */ - ServerInstance->Rehash("due to rehash command from GUI"); - thread->SetResult(0); - thread->ClearStatus(); - break; - case '2': - /* Shutdown */ - thread->SetResult(0); - thread->ClearStatus(); - ServerInstance->Exit(EXIT_STATUS_NOERROR); - break; - case '3': - /* Restart */ - thread->SetResult(0); - thread->ClearStatus(); - ServerInstance->Restart("Restarting due to command from GUI"); - break; - } -} - -IPC::~IPC() -{ - thread->SetExitFlag(); - delete thread; +IPC::IPC(InspIRCd* Srv) : ServerInstance(Srv)
+{
+ /* The IPC pipe is threaded */
+ thread = new IPCThread(Srv);
+ Srv->Threads->Create(thread);
+}
+
+void IPC::Check()
+{
+ switch (thread->GetStatus())
+ {
+ case 'N':
+ /* No-Operation */
+ thread->SetResult(0);
+ thread->ClearStatus();
+ break;
+ case '1':
+ /* Rehash */
+ ServerInstance->Rehash("due to rehash command from GUI");
+ thread->SetResult(0);
+ thread->ClearStatus();
+ break;
+ case '2':
+ /* Shutdown */
+ thread->SetResult(0);
+ thread->ClearStatus();
+ ServerInstance->Exit(EXIT_STATUS_NOERROR);
+ break;
+ case '3':
+ /* Restart */
+ thread->SetResult(0);
+ thread->ClearStatus();
+ ServerInstance->Restart("Restarting due to command from GUI");
+ break;
+ }
+}
+
+IPC::~IPC()
+{
+ thread->SetExitFlag();
+ delete thread;
}
\ No newline at end of file |