Re: MsgWaitForSingleObject and named pipe. Which event am I getting ?
"R.Wieser" <[email protected]> Wed, 18 Mar 2026 21:46:51 +0100
| Newsgroups | comp.os.ms-windows.programmer.win32,alt.comp.os.windows-xp,alt.windows7.general |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
Richard, >> I would like to write some single-threaded code to work with a >> single non-blocking, non-overlapped (incoming) named pipe, in >> combination with MsgWaitForSingleObject - the latter as part of >> the message-loop. > > Well, if you want to do non-blocking I/O on Win32, that is done > using FILE_FLAG_OVERLAPPED when you create the pipe. You mean that the PIPE_NOWAIT flag is just thrown in there for shits-and-giggles, but doesn't actually /do/ anything ? :-) > "Overlapped I/O" on Win32 just means asynchronous non-blocking I/O. And that, it being asynchronous, is exactly what I'm trying to evade. > The problem is that MsgWaitForSingleObject can't wait on a pipe, > it can only wait on kernel synchronization objects: events, > mutexes, processes. That would throw quite a wrench into my idea. :-| > FYI, I got this answer by literally copy/pasting your question > into google's AI (gemini), but I reviewed the Win32 API > documentation to verify that the suggested approach makes sense. :-) You can ask an AI for information, but to be able determine if what it says makes sense smeans you till need to know your stuff (or you stand the chance to repeat its "hallucinations" as facts). [snip code] Thanks for that. Regards, Rudy Wieser