mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-11 09:58:10 +00:00
[idd] helper/PipeClient: use event and async I/O to interrupt read
An event, `m_signal`, is created and signalled when either `m_running` or `m_connected` is changed by another thread, so that the pipe thread knows to interrupt the read. The pipe is now opened as async to allow interruption, and the I/O operations now use overlapped I/O. Other changes include: * Changing `m_pipe` to `HandleT<HANDLETraits>` since `CreateFile` returns `INVALID_HANDLE_VALUE` instead of `NULL` on error. * Remove the call to `WaitNamedPipeA` because it's useless and returns immediately without waiting if the pipe doesn't exist.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* Looking Glass
|
||||
* Copyright © 2017-2025 The Looking Glass Authors
|
||||
* https://looking-glass.io
|
||||
@@ -33,8 +33,10 @@ using namespace Microsoft::WRL::Wrappers::HandleTraits;
|
||||
class CPipeClient
|
||||
{
|
||||
private:
|
||||
HandleT<HANDLENullTraits> m_pipe;
|
||||
HandleT<HANDLETraits> m_pipe;
|
||||
HandleT<HANDLENullTraits> m_thread;
|
||||
HandleT<EventTraits> m_signal;
|
||||
|
||||
bool m_running = false;
|
||||
bool m_connected = false;
|
||||
|
||||
|
Reference in New Issue
Block a user