I'm looking at a project which will require inter-process communication between a legacy Windows application using named pipes, and a new service running on a Linux server. The windows application cannot be changed. Does anyone know if there is a Linux library available that supports Windows named pipes? Or even better, can anyone recommend a library they have used for this purpose?
-
A pipe is local communication system, it does not expand to networks... so how should a Linux system get access to a pipe on a Windows system, which by definition must be a different system (even a VM) ? Or do you want to know how to write a proxy or something like that ?DarkDust– DarkDust2010-10-18 14:38:49 +00:00Commented Oct 18, 2010 at 14:38
-
4@DarkDust: Windows named pipes are exported over the network name space. You can open one from another Windows machine with the correct security attributes and prepending the pipe name with the WINS name.Amardeep AC9MF– Amardeep AC9MF2010-10-18 14:40:51 +00:00Commented Oct 18, 2010 at 14:40
-
Windows named pipes work differently from the standard Linux ones, and do work across a network. I'm asking if anyone has written a library in Linux to support Windows named pipes.MichaelB76– MichaelB762010-10-18 14:45:17 +00:00Commented Oct 18, 2010 at 14:45
-
In the end I wrote a Windows proxy service which bridged between a Windows pipe and a socket.MichaelB76– MichaelB762014-04-30 16:14:14 +00:00Commented Apr 30, 2014 at 16:14
2 Answers
Windows and Linux named pipes are different animals. If an interop solution exists you are going to be one of a very small population of users.
You might be better off writing a proxy on the Windows side to map between Named Pipe and socket, and connecting this to a socket on the Linux end. This provides you a useful networked interface on the Linux side going forward, and removes what might be a world of Named Pipes interop hurt from the picture.
If I was doing this I would try to produce a simple passthrough proxy in C# (managed code) as a proof of concept. Can always convert to native code (Win32/C++) if throughput does not measure up. There is some sample C# code here that might be a useful reference.
Here is background on the nuances of Windows vs Linux named pipes.
2 Comments
I bet Samba/Winbind contains highly relevant code. Not sure how reusable it is, though.
2 Comments
IPC$ share. The "files" in this share are really named pipes which connect to the file server process.