为什么命名管道是本地的?

发布于 2024-08-11 01:31:30 字数 97 浏览 3 评论 0 原文

我记得使用命名管道在两台机器之间进行通信(回到 Windows NT)。 为什么现在我读到命名管道仅用于同一台计算机中的进程间通信? (在 Vista 和 Windows 7 中)

I remember using Named Pipes for communicating between 2 machines (back in Windows NT).
How come now I read that Named Pipes are only for Inter Process Communication in the SAME machine? (in Vista and Windows 7)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱你不解释 2024-08-18 01:31:30

命名管道作为操作系统基础结构完全可用于机器间通信 - 请参阅 有关命名管道的 MSDN 文档

命名管道可用于提供
上进程之间的通信
同一台计算机或同一计算机上的进程之间
网络上的不同计算机。
如果服务器服务正在运行,全部
命名管道可远程访问。
如果您打算使用命名管道
仅限本地,拒绝访问 NT
AUTHORITY\NETWORK 或切换到本地
RPC。

但是,我假设您可能正在谈论 WCF 绑定“NetNamedPipe”,它确实是仅在同一台计算机上进行通信。为什么会出现这种情况,你必须询问 WCF 设计团队 - 我没有任何相关信息。

但正如 Stephen C 所说 - 如果您需要机器对机器通信(在 WCF 中),请使用 netTcpBinding - 两者在功能、速度和功能集方面非常相似。

请参阅这篇有关 .NET 3.5 中添加的支持的文章 对于命名管道。

马克

Named pipes as an OS infrastructure are totally available for between-machine communication - see the MSDN docs on Named Pipes.

Named pipes can be used to provide
communication between processes on the
same computer or between processes on
different computers across a network.
If the server service is running, all
named pipes are accessible remotely.
If you intend to use a named pipe
locally only, deny access to NT
AUTHORITY\NETWORK or switch to local
RPC.

However, I assume you might be talking about the WCF binding "NetNamedPipe" which indeed is on-same-machine-only communication. Why that's the case is something you'd have to ask the WCF design team - I don't have any information on that.

But as Stephen C rightfully says - if you need machine-to-machine communication (in WCF), use the netTcpBinding instead - the two are fairly similar in their capabilities and their speed and feature set.

See this article on the support added in .NET 3.5 for named pipes.

Marc

爱已欠费 2024-08-18 01:31:30

因为如果它们是非本地的,它们将被称为套接字。

编辑:实际上,这是一个相当轻率、以 UNIX 为中心的答案。在 UNIX 上,命名管道仅用于本地通信。相比之下,套接字可用于本地和非本地通信,并且可以使用多种传输协议。另一个区别在于您找到它们的方式。命名管道通常位于文件系统命名空间中。套接字(或更准确地说,套接字端点)由某种网络地址标识,通常在某种名称服务器/服务中查找该网络地址。

Because if they were non-local they'd be called Sockets.

EDIT: actually, that is a rather a flippant, UNIX-centric answer. On UNIX, a named pipe is for local communication only. By contrast, sockets can be used for both local and non-local communication, and can use a variety of transport protocols. Another difference is in the way that you find them. Named pipes are typically found in the filesystem namespace. Sockets (or more precisely, the socket end points) are identified by a network address of some kind which is typically looked up in some kind of name server / service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文