简体   繁体   中英

ReadFile function for an anonymous pipe

I have a question about Windows pipes. In ReadFile function manual is written:

If an anonymous pipe is being used and the write handle has been closed, when ReadFile attempts to read using the pipe's corresponding read handle, the function returns FALSE and GetLastError returns ERROR_BROKEN_PIPE.

Lets assume that read from a pipe occurs every second. From the last read operation the following has happened: the write to the pipe operation and a close of the write handler. According to the manual above, the function returns false - reading operation fail. My question what happens with data that was not read? How I can get them?

如您所料,将数据放入管道后,您可以读出数据直到到达数据末尾, 然后读取将失败。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM