Windows在Linux中命名管道支持 [英] Windows Named Pipe Support in Linux

查看:216
本文介绍了Windows在Linux中命名管道支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个项目,该项目需要使用命名管道的旧版Windows应用程序与Linux服务器上运行的新服务之间的进程间通信. Windows应用程序无法更改.有谁知道是否有可用的Linux库支持Windows命名管道?甚至更好的是,有人可以推荐他们为此目的使用的库吗?

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?

推荐答案

Windows和Linux命名管道是不同的动物.如果存在互操作解决方案,您将成为极少数用户之一.

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.

您最好在Windows端编写一个代理以在命名管道和套接字之间进行映射,然后将其连接到Linux端的套接字.这将为您提供Linux方面的有用的网络接口,并消除图片中可能是命名管道"互操作的世界.

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.

如果我这样做,我将尝试使用C#(托管代码)产生一个简单的直通代理作为概念证明.如果吞吐量无法衡量,则始终可以转换为本机代码(Win32/C ++).在此处中有一些示例C#代码可能是有用的参考.

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.

这是关于Windows与Linux命名管道之间细微差别的背景.

这篇关于Windows在Linux中命名管道支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆