Concurrent read/write of named pipe in Java (on windows)

后端 未结 5 810
悲哀的现实
悲哀的现实 2020-12-09 23:57

I\'m trying to provide communication between a C# app and a Java app on windows using named pipes with the method described by v01ver in this question: How to open a Windows

5条回答
  •  有刺的猬
    2020-12-10 00:26

    I'm not familiar with JAVA, and my C# is pretty elementary too. However I'm had a similar problem with a multithreaded C++ client that I fixed by opening the pipe for overlapped IO. Until I did this, Windows serialized reads and writes, effectively causing an unsatisfied (blocking) ReadFile to prevent completion of a subsequent WriteFile until the read was done.

    See CreateFile function
    FILE_FLAG_OVERLAPPED

提交回复
热议问题