I have a pipe handle that was created as overlapped. I need to read and write data to it in parallel. How can I achieve this?
Named Pipe Server Using Overlapped I/O documentation page shows an example how to read and write to many pipes, but "it avoids simultaneous operations on a single pipe instance".
What is the right way to do this in C++ on Windows? I can't file the right example nor some help on the topic.
The main problem I face that normal ReadFile blocks when there is no data to read and eventually I can't write with WriteFile. I haven't found any method that can tell me is there something to read that don't block. As far as I understand I need to pass OVERLAPPED structure but don't know how to use it in case of parallel read and write to one pipe (not many).
It should be possible as it is said in Synchronous and Overlapped Pipe I/O:
Overlapped operations make it possible for one pipe to read and write data simultaneously and for a single thread to perform simultaneous I/O operations on multiple pipe handles.