views:

80

answers:

2

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?

+8  A: 

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.

Steve Townsend
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
@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?
Steve Townsend
+2  A: 

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

Andrew Medico
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.
MarkR
Thanks, interesting thought.
MichaelB76