C++: Implementing Named Pipes using the Win32 API

后端 未结 2 2044
北海茫月
北海茫月 2020-12-25 14:34

I\'m trying to implement named pipes in C++, but either my reader isn\'t reading anything, or my writer isn\'t writing anything (or both). Here\'s my reader:



        
2条回答
  •  误落风尘
    2020-12-25 14:40

    A named pipe client can open the named pipe with CreateFile -- but the named pipe server needs to use CreateNamedPipe to create the named pipe. After it's created the named pipe, the server uses ConnectNamedPipe to wait for a client to connect. Only after the client has connected should the server do a blocking read like your call to ReadFile.

提交回复
热议问题