[IPC]: Use an aux namedpipe to clear main namedpipe left by last process

This commit is contained in:
fanlumaster committed 2025-05-13 10:06:52 +08:00
1 parent 83d0854613
commit b0baf6f205
5 files changed
+120 -11

No files matched your search

+9
View File
@@ -25,9 +25,16 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
std::thread worker(WorkerThread);
std::thread listener(EventListenerLoopThread);
//
// Pipe
//
// Named Pipe for IPC between tsf and server
std::thread pipe_worker(FanyNamedPipe::WorkerThread);
std::thread pipe_listener(FanyNamedPipe::EventListenerLoopThread);
::mainPipeThread = pipe_listener.native_handle();
// Aux Named Pipe for reconnecting main pipe
std::thread aux_pipe_listener(FanyNamedPipe::AuxPipeEventListenerLoopThread);
int ret = CreateCandidateWindow(hInstance);
@@ -41,5 +48,7 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
pipe_worker.join();
pipe_listener.join();
aux_pipe_listener.join();
return ret;
}