WinAPI C++ client detect write on anonymous pipe before reading

前端 未结 3 1943
清酒与你
清酒与你 2021-01-20 23:35

I am writing a C++ (Windows) client console application which reads from an anonymous pipe on STDIN. I would like to be able to use my program as follows:

echo i         


        
3条回答
  •  孤独总比滥情好
    2021-01-21 00:06

    This also works without overlapped I/O while using a second thread, that does the synchronous ReadFile-call. Then the main thread waits an arbitrary amount of time and acts like above...

    Hope this helps...

提交回复
热议问题