我需要一个能在进程内异步通信的PIPE,但CreatePipe并没有dwOpenMode这一参数,而NamedPipe似乎又不能在进程内Connect,我在想是否有SetFileMode之类的调用可以修改文件的打开模式?或者有什么其它办法能满足我的需求?

解决方案 »

  1.   

    不能,楼主 匿名管道不是什么SOCKET啊 啥的 底层实现就不一样,概念也不同
      

  2.   

    When a process uses WriteFile to write to an anonymous pipe, the write operation is not completed until all bytes are written. If the pipe buffer is full before all bytes are written, WriteFile does not return until another process or thread uses ReadFile to make more buffer space available.Anonymous pipes are implemented using a named pipe with a unique name. Therefore, you can often pass a handle to an anonymous pipe to a function that requires a handle to a named pipe.
      

  3.   

    http://blog.csdn.net/caowei880123/article/details/6117746
    希望对你有帮助
      

  4.   

    建议LZ看下SUNXIN的讲座,有一节专门讲这个内容(进程间通讯)。
      

  5.   

    呃   可能是我描述的不清楚吧,我要的是非阻塞IO, 可以放到IOCP里去的, 异步IO和非阻塞IO好像不是一回事,不过我有一点混淆
      

  6.   

    按照三楼的说法, 匿名Pipe是用NamedPipe实现的,  那既然NamedPipe可以实现非阻塞IO,匿名Pipe应该有机会的呀
      

  7.   

    我找到一个SetNamedPipeHandleState, 希望这个东西管用
      

  8.   

    NamedPipe在进程内是可以连接的,是我之前把顺序弄错了  此贴散分