Is there a way to perform ReadFile with timeout in Windows XP?
If not, is there a way to break the pipe from other thread?
Set up an asynchronous ReadFile using Overlapped I/O. You can then use CancelIOEx to cancel the read at any time.
Assuming you're talking about a named pipe, the usual way is to do an overlapped read, and specify a timeout when you call WaitForSingleObject (or WaitForMultipleObjects). When/if the timeout expires, the wait will return WAIT_TIMEOUT instead of WAIT_OBJECT_0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With