4

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?

4
  • 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 ? Commented 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. Commented 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. Commented Oct 18, 2010 at 14:45
  • In the end I wrote a Windows proxy service which bridged between a Windows pipe and a socket. Commented Apr 30, 2014 at 16:14

2 Answers 2

13

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. the idea of writing a proxy on the Windows side had occurred to me, but I'm metting resistance on the idea of installing anything on the Windows server...
@MichaelB76 - how frustrating ... hopefully a well-argued presentation of risks and costs in trying to do NP interop can swing the argument for you. What is the Windows OS? One machine, or many?
4

I bet Samba/Winbind contains highly relevant code. Not sure how reusable it is, though.

2 Comments

I think the Samba suite contains something useful; not sure how to use it though. Some of the samba tools must internally connect to NT named pipes.
Correct. The key here is the IPC$ share. The "files" in this share are really named pipes which connect to the file server process.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.