hi i need to get output from ipc pipe.i have a software document with these contents :
and NamedPipeClientStream sample is :.
.
.
Unfortunately, it's not as easy to test the IPC protocol on Windows, since Windows ports of socat (in
Cygwin and MSYS2) don't understand named pipes. In the absence of a simple tool to send and receive
from bidirectional pipes, the echo command can be used to send commands, but not receive replies from
the command prompt.
You can send commands from a command prompt :
To be able to simultaneously read and write from the IPC pipe, like on Linux, it's necessary to write anCode:echo commands >\\.\pipe\mypipename
external program that uses overlapped file I/O (or some wrapper like .NET's NamedPipeClientStream.)
You can open the pipe in PuTTY as "serial" device. This is not very comfortable, but gives a way to test
interactively without having to write code
Unfortunately, although I tested many examples in the forum, I still could not get the output fromCode:using System; using System.IO; using System.IO.Pipes; class PipeClient { static void Main(string[] args) { using (NamedPipeClientStream pipeClient = new NamedPipeClientStream(".", "testpipe", PipeDirection.In)) { // Connect to the pipe or wait until the pipe is available. Console.Write("Attempting to connect to pipe..."); pipeClient.Connect(); Console.WriteLine("Connected to pipe."); Console.WriteLine("There are currently {0} pipe server instances open.", pipeClient.NumberOfServerInstances); using (StreamReader sr = new StreamReader(pipeClient)) { // Display the read text to the console string temp; while ((temp = sr.ReadLine()) != null) { Console.WriteLine("Received from server: {0}", temp); } } } Console.Write("Press Enter to continue..."); Console.ReadLine(); } }
for example this command in linux :Code:echo commands >\\.\pipe\mypipename
get result :Code:echo '{ "command": ["aa", "bb"] }' | socat - /mypipename
but with convert to pipe in widnows :Code:{"data":xxxxxx,"error":"success"}
return hidden data like as empty the only way need connect to that \\.\pipe\mypipename and stream output dataCode:echo { "command": ["aa", "bb"] } >\\.\pipe\mypipename
I also tested your attachment and it did not work, how could I get the output?




Reply With Quote
