开发者

C++ Pipe ReadFile function set timeout in Windows XP

Is there a way to perform ReadFile with timeout in Windows XP?

If not, is there a way to break the pipe from oth开发者_StackOverflow社区er 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜