title: Is there any way to detect whether client pipe's handle is closed when using NamedPipe?
body: <p>I am wondering if there is a way to detect the status of client pipe's handle from the server side on Windows platform.</p>
  
  <p>Even though the client closed the pipe(disconnected) with <code>CloseHandle()</code> function, there seems to be no way to detect it from the server side.</p>
  
  <p>Using <code>WaitForSingleObject()</code> with handle object returns <code>WAIT_OBJECT_0</code>, regardless of the status of client handle. So, what would be a good solution to detect whether client pipe's handle is closed or not from server side with less cost?</p>